Showing posts with label application. Show all posts
Showing posts with label application. Show all posts

Friday, March 30, 2012

How to rename a table ?

Hi all.

I'm porting an application from eVB-ADOCE to VB.Net-SQL CE

In the old application there are some SQL statements like this:

"ALTER TABLE OldTable TO NewTable"

Is there an equivalent instruction or a simple way to rename a table?

I was not able to find anything simple to do the same.

I really need NOT to do something like

SELECT * INTO NewTable FROM OldTable

because the resulting table could go outside memory and/or spend too much time in elaboration.

Please let me know what I can do.

Many thanks !

As far as I know, there is no such option from SQL. But you can rename a table (and a table column) using OLE DB:

QA: How do I rename a SQL CE table?

|||This is very interesting, and I read your article, but I'm so ignorant in C++ that I've not been able to translate your code in VB. |||

Don't worry - I'm working on an article that will allow you to do this from .NET CF on a device. I will post this article either today or tomorrow.

|||

Jo?o Paulo Figueira wrote:

Don't worry - I'm working on an article that will allow you to do this from .NET CF on a device. I will post this article either today or tomorrow.

That will be wonderful !

|||

As promised, here is the article:

Renaming a SQL CE Table From a .NET CF Application

|||

Joao Paulo,

I don't know how to say "thank you" for your kindness. I'm going to use your work just now.

If you come to Milano (Italy), please let me know ! I shall organize a good dinner for you

Thank you very much again !

Wednesday, March 28, 2012

How to remove lock?

From Sql-server enterprise manager : Management-Current Activity-Locks/Process ID, I found several locks, which preventing some of application working property.
So, I want to remove locks manually.
How Can I do this?do sp_who2 and post the results...

Do mean you blocking? Locks are held until the work is done...which is what should be happening...

if it's a blocked spid, you'll probably have to kill the blocking spid...|||I tried to kill process of the locks(property, Kill Process) but, it doesn't work!

1 BACKGROUND sa . . NULL LAZY WRITER 563 0 06/15 13:44:44 1
2 BACKGROUND sa . . master SIGNAL HANDLER 31 0 06/15 13:44:44 2
3 sleeping sa . . NULL LOG WRITER 9719 0 06/15 13:44:44 3
4 BACKGROUND sa . . NULL LOCK MONITOR 141 0 06/15 13:44:44 4
5 BACKGROUND sa . . master TASK MANAGER 0 530 06/15 13:44:44 5
6 BACKGROUND sa . . master TASK MANAGER 0 0 06/15 13:44:44 6
7 sleeping sa . . NULL CHECKPOINT SLEEP 94 282 06/15 13:44:44 7
8 BACKGROUND sa . . master TASK MANAGER 0 0 06/15 13:44:44 8
9 BACKGROUND sa . . master TASK MANAGER 0 11 06/15 13:44:44 9
10 BACKGROUND sa . . master TASK MANAGER 0 0 06/15 13:44:44 10
11 BACKGROUND sa . . master TASK MANAGER 0 0 06/15 13:44:44 11
12 BACKGROUND sa . . master TASK MANAGER 0 0 06/15 13:44:44 12
13 BACKGROUND sa . . master TASK MANAGER 0 20 06/15 13:44:44 13
14 BACKGROUND sa . . master TASK MANAGER 0 10 06/15 13:44:44 14
15 BACKGROUND sa . . master TASK MANAGER 0 0 06/15 13:44:44 15
51 sleeping HRUser IT009 . TimeClock AWAITING COMMAND 9892 228 06/21 13:05:58 MS SQLEM 51
52 sleeping HRUser MIS008 . TimeClock AWAITING COMMAND 0 0 06/21 13:19:14 .Net SqlClient Data Provider 52
53 sleeping HRUser MIS008 . TimeClock AWAITING COMMAND 0 0 06/21 13:19:14 .Net SqlClient Data Provider 53
54 sleeping HRUser IT009 . TimeClock AWAITING COMMAND 0 0 06/21 13:07:43 prjMapDrive 54
55 RUNNABLE HRUser IT009 . TimeClock SELECT INTO 16 3 06/21 13:19:21 SQL Query Analyzer 55
56 sleeping HRUser PAY0516 . TimeClock AWAITING COMMAND 63 0 06/21 12:58:38 56
57 sleeping NT_DOMAIN\Administrator MIS008 . msdb AWAITING COMMAND 93 29 06/17 09:57:05 SQLAgent - Generic Refresher 57
58 sleeping NT_DOMAIN\Administrator MIS008 . msdb AWAITING COMMAND 601318 1 06/21 13:19:26 SQLAgent - Alert Engine 58
63 sleeping HRUser PAY0516 . TimeClock AWAITING COMMAND 219 0 06/21 12:59:05 63|||Which process did you try to kill?|||I do not see any blocking activity in this output. Are you sure there is a problem? Maybe I am not understanding what the problem is?|||I want to remove TimeClock DB related locks..
Since My application has problem with transaction on TimeClock DB, it sometimes begins transaction and doesn't commit or rollback. In this case problem occurs...
Then I have to remove locks related those transaction. but, I couldn't...
I just stopped Sql server and restarted.. But, I want to remove locks without restarting and affecting other DBs.

Thanks...|||Fix the application. Anytime an application has a timeout, it should automatically roll back the transaction. Killing processes is dangerous and should only be used in rare, extreme cases.|||If the application is leaving transactions open, without committing them, you can use dbcc opentran to identify the connection (SPID) that is at fault. This command must be run from the TimeClock database. With this information, you can convince the vendor/contractor/programmer to clean up their mess.sql

How to remove dup entries


Hi All
In my application i have to get the data from .csv file. My requirement is that file may consists of duplicate entries
I ant to remove the dup entries and i want to place in the table.
Waiting for valuable replies
Thank u
Baba

Suppose the text file is:

1, MAK, A9411792711, 3400.25
2, Claire, A9411452711, 24000.33
3, Sam, A5611792711, 1200.34
2, Claire, A9411452711, 24000.33

And you want to import it into table T1

Here it is:

SET NOCOUNT ON;
USE tempdb;
IF OBJECT_ID('T1') IS NOT NULL
DROP TABLE T1;
IF OBJECT_ID('T2') IS NOT NULL
DROP TABLE T2;

CREATE TABLE T1(
id int primary key,
[Name] sysname,
code sysname,
num decimal(10,2)
)
GO

SELECT * INTO T2 FROM T1 WHERE 1 = 2;

BULK INSERT tempdb.dbo.T2 FROM 'd:\tmp\test.txt'
WITH (FIELDTERMINATOR = ',', ROWTERMINATOR = '\n')

INSERT INTO T1 SELECT DISTINCT * FROM T2;
GO

SELECT * FROM T1;

The output is:

id Name code num
-- -- --
1 MAK A9411792711 3400.25
2 Claire A9411452711 24000.33
3 Sam A5611792711 1200.34

|||

hi

what is your way to import the data. If it is a ETL process with a select-statement use

select distinct * from yourcsv

The other way is, to import in a temp-table. after this copy the data to the correct table with

insert table

select distinct * from temptable

To get all dup entries use

select * from table where [onecolumnofrow] in

(select [samecolumn] from table group by [samecolumn] having count(*) > 1)

If there is only ONE dup entri you can delete this with DELETE top 1 * with the same where-clause

Bye

Thorsten Ueberschaer

sql

Friday, March 23, 2012

How to refresh Full Text Indexes?

Hi All,

i am using full text search in stored procedure for my web application search-engine.

how do i refresh my fulltext indexes which i created using unique indexes?

as i can see two options Tongue Tiedtart full population and Start Incremental population in full-text index on right click of table.

on click of anyone its showing successful.

can anyone please let me know what is the standard way to refresh full text indexes periodically in terms of best performance? i found, when i run query first time with contains keyword , it takes much time.

what enterprise settings required to increase performance?

Thanks in advance.

When you start a population of a fulltext catalog, it reports successful but that only means its started successfully. The population can take a while depending on size of columns, number of rows etc.

Depending on the size of the index and how long it takes to do a full population, you may want to do run regular incremental populations which will only update the records that have been added/changed since the last full population. Population is quite a resource intensive process so be aware of what effect it has on your application. Also remember you'll need to add a timestamp field to any tables which you want to do incremental populations on.

If you need to realtime updates to happen, look into enabling change tracking/background update which will keep your index in sync with the data. Otherwise, new/changed rows won't be reflected in your fulltext index until you do another population.

As with any index, as data gets added and removed the index becomes fragmented so i'd look to schedule a rebuild of the catalog periodically (how frequent is up to you).

The first query may have been slow as the population may still have been in progress. Look at FULLTEXTCATALOGPROPERTY to check the size of the index and the current population status.

HTH!

|||

Hello,

thanks a lot for the reply.

can you please verify the way how i created Index?

create fulltext catalog MyFullTextCatalog

create unique index ui_AssetID on EMAM_Assets(ID)

create fulltext index on EMAM_Assets(title,asset_desc) KEY INDEX ui_AssetID on MyFullTextCatalog
with CHANGE_TRACKING AUTO

i created full text index as mentioned above. i want to perform search on title and asset_desc.

I created one schedule (daily) on table -> full text properties to populate full text index. I didnt get your point about timestamp. where do i need to add and how to use it? where will it be helpful?

second, i click on Full text Catalog property, its showing error: Property FullTextIndexSize is not available for FulltextCatalog. This property may not exist or may not be retrieved. once i click on OK on this error alert, its opening Full Text Catalog Property. Is it something wrong?

Please guide me in set up Administration configuration for Full Text Index. I am working on Search Engine and Query performance is very much important. i having 5 tables on which i need to perform search.

|||

You need to add a new column to the table you are running incremental populations on with a datatype of TIMESTAMP, the value of which is controlled by SQL Server to keep track of changes to records in the table.

With the commands you have used, SQL Server should populate the catalog as soon as the index is created. Rather than using the GUI to check the property, use FULLTEXTCATALOGPROPERTY in a query window (see Books Online for more details). The error you get may be related to the GUI rather than your full text catalog.

Have a look at the following link which has some great tips on Full Text Searching:

http://www.microsoft.com/technet/prodtechnol/sql/bestpractice/ftslesld.mspx


HTH!

|||

Hi,

thanks for valuable input.

I created full text index with Change Track Automatically.

As i understand, in that case i need not to worry about full text population. is that right?

Full text index refresh will be done automatically. right?

let me know if it is required in this case also.

i already removed schedule for full text index population.

now i am facing on big problem is that: Query taking around 1 min while executing first time.

after that if u will be sit ideal for around 20 min then once again query will take more time.

instant execution followed by first one will result very fast.

I will check for cache memory and I/O for that. i think it could be reason.

Please let me know if you have any idea.

Thanks.

|||

You're right- once you've enabled change tracking a Full Population should happen automatically and the index will be maintained by sql server.


Make sure that the initial full population of the catalog has completed before running a query as it will be quite a resource intensive process and may be the cause of your slow query,


Good luck!

How to refresh Full Text Indexes?

Hi All,

i am using full text search in stored procedure for my web application search-engine.

how do i refresh my fulltext indexes which i created using unique indexes?

as i can see two options Tongue Tiedtart full population and Start Incremental population in full-text index on right click of table.

on click of anyone its showing successful.

can anyone please let me know what is the standard way to refresh full text indexes periodically in terms of best performance? i found, when i run query first time with contains keyword , it takes much time.

what enterprise settings required to increase performance?

Thanks in advance.

When you start a population of a fulltext catalog, it reports successful but that only means its started successfully. The population can take a while depending on size of columns, number of rows etc.

Depending on the size of the index and how long it takes to do a full population, you may want to do run regular incremental populations which will only update the records that have been added/changed since the last full population. Population is quite a resource intensive process so be aware of what effect it has on your application. Also remember you'll need to add a timestamp field to any tables which you want to do incremental populations on.

If you need to realtime updates to happen, look into enabling change tracking/background update which will keep your index in sync with the data. Otherwise, new/changed rows won't be reflected in your fulltext index until you do another population.

As with any index, as data gets added and removed the index becomes fragmented so i'd look to schedule a rebuild of the catalog periodically (how frequent is up to you).

The first query may have been slow as the population may still have been in progress. Look at FULLTEXTCATALOGPROPERTY to check the size of the index and the current population status.

HTH!

|||

Hello,

thanks a lot for the reply.

can you please verify the way how i created Index?

create fulltext catalog MyFullTextCatalog

create unique index ui_AssetID on EMAM_Assets(ID)

create fulltext index on EMAM_Assets(title,asset_desc) KEY INDEX ui_AssetID on MyFullTextCatalog
with CHANGE_TRACKING AUTO

i created full text index as mentioned above. i want to perform search on title and asset_desc.

I created one schedule (daily) on table -> full text properties to populate full text index. I didnt get your point about timestamp. where do i need to add and how to use it? where will it be helpful?

second, i click on Full text Catalog property, its showing error: Property FullTextIndexSize is not available for FulltextCatalog. This property may not exist or may not be retrieved. once i click on OK on this error alert, its opening Full Text Catalog Property. Is it something wrong?

Please guide me in set up Administration configuration for Full Text Index. I am working on Search Engine and Query performance is very much important. i having 5 tables on which i need to perform search.

|||

You need to add a new column to the table you are running incremental populations on with a datatype of TIMESTAMP, the value of which is controlled by SQL Server to keep track of changes to records in the table.

With the commands you have used, SQL Server should populate the catalog as soon as the index is created. Rather than using the GUI to check the property, use FULLTEXTCATALOGPROPERTY in a query window (see Books Online for more details). The error you get may be related to the GUI rather than your full text catalog.

Have a look at the following link which has some great tips on Full Text Searching:

http://www.microsoft.com/technet/prodtechnol/sql/bestpractice/ftslesld.mspx


HTH!

|||

Hi,

thanks for valuable input.

I created full text index with Change Track Automatically.

As i understand, in that case i need not to worry about full text population. is that right?

Full text index refresh will be done automatically. right?

let me know if it is required in this case also.

i already removed schedule for full text index population.

now i am facing on big problem is that: Query taking around 1 min while executing first time.

after that if u will be sit ideal for around 20 min then once again query will take more time.

instant execution followed by first one will result very fast.

I will check for cache memory and I/O for that. i think it could be reason.

Please let me know if you have any idea.

Thanks.

|||

You're right- once you've enabled change tracking a Full Population should happen automatically and the index will be maintained by sql server.


Make sure that the initial full population of the catalog has completed before running a query as it will be quite a resource intensive process and may be the cause of your slow query,


Good luck!

Monday, March 19, 2012

How to redirect report to a frame?

Hi,
I've a web application. The default page consists of
three frames. 'List bar frame', 'Banner frame' and 'Main
frame'. Reports are displayed on this 'Main frame'.
I've a report which has got a column which is linked to
another report. I want the second report to be displayed
in the same frme ('Main frame'). Right now while
clicking the link column, report is displayed in the
parent frame, there by I'm loosing list bar and banner in
the application. How do I do this?
thanks,
DeeWhen you access the parent report in your frame, add the URL access
parameter rc:LinkTarget=framename. This will target all of the hyperlinks in
the report. You can also do stuff like rc:LinkTarget=_blank to open in a new
window.
--
Bryan Keller
Developer Documentation
SQL Server Reporting Services
A friendly reminder that this posting is provided "AS IS" with no
warranties, and confers no rights.
"Deepak" <deee@.discussions.microsoft.com> wrote in message
news:02e201c46d7c$f84dff50$a501280a@.phx.gbl...
> Hi,
> I've a web application. The default page consists of
> three frames. 'List bar frame', 'Banner frame' and 'Main
> frame'. Reports are displayed on this 'Main frame'.
> I've a report which has got a column which is linked to
> another report. I want the second report to be displayed
> in the same frme ('Main frame'). Right now while
> clicking the link column, report is displayed in the
> parent frame, there by I'm loosing list bar and banner in
> the application. How do I do this?
> thanks,
> Dee|||After giving rc:LinkTarget=framename, second report is
opening in a new window. Not in the given frame. I'm
using Jump to report method for calling 2nd report.
thanks,
Deee
>--Original Message--
>When you access the parent report in your frame, add the
URL access
>parameter rc:LinkTarget=framename. This will target all
of the hyperlinks in
>the report. You can also do stuff like
rc:LinkTarget=_blank to open in a new
>window.
>--
>Bryan Keller
>Developer Documentation
>SQL Server Reporting Services
>A friendly reminder that this posting is provided "AS
IS" with no
>warranties, and confers no rights.
>
>"Deepak" <deee@.discussions.microsoft.com> wrote in
message
>news:02e201c46d7c$f84dff50$a501280a@.phx.gbl...
>> Hi,
>> I've a web application. The default page consists of
>> three frames. 'List bar frame', 'Banner frame'
and 'Main
>> frame'. Reports are displayed on this 'Main frame'.
>> I've a report which has got a column which is linked to
>> another report. I want the second report to be
displayed
>> in the same frme ('Main frame'). Right now while
>> clicking the link column, report is displayed in the
>> parent frame, there by I'm loosing list bar and banner
in
>> the application. How do I do this?
>> thanks,
>> Dee
>
>.
>|||You will need to use jump to URL action and build the URL as an expression,
adding rc:LinkTarget. I know it is not ideal, but it is the suggested
workaround for your scenario.
--
Bryan Keller
Developer Documentation
SQL Server Reporting Services
A friendly reminder that this posting is provided "AS IS" with no
warranties, and confers no rights.
"Deepak" <dee@.discussions.microsoft.com> wrote in message
news:05b901c46e31$d7519f40$a501280a@.phx.gbl...
> After giving rc:LinkTarget=framename, second report is
> opening in a new window. Not in the given frame. I'm
> using Jump to report method for calling 2nd report.
> thanks,
> Deee
> >--Original Message--
> >When you access the parent report in your frame, add the
> URL access
> >parameter rc:LinkTarget=framename. This will target all
> of the hyperlinks in
> >the report. You can also do stuff like
> rc:LinkTarget=_blank to open in a new
> >window.
> >
> >--
> >Bryan Keller
> >Developer Documentation
> >SQL Server Reporting Services
> >
> >A friendly reminder that this posting is provided "AS
> IS" with no
> >warranties, and confers no rights.
> >
> >
> >"Deepak" <deee@.discussions.microsoft.com> wrote in
> message
> >news:02e201c46d7c$f84dff50$a501280a@.phx.gbl...
> >> Hi,
> >>
> >> I've a web application. The default page consists of
> >> three frames. 'List bar frame', 'Banner frame'
> and 'Main
> >> frame'. Reports are displayed on this 'Main frame'.
> >> I've a report which has got a column which is linked to
> >> another report. I want the second report to be
> displayed
> >> in the same frme ('Main frame'). Right now while
> >> clicking the link column, report is displayed in the
> >> parent frame, there by I'm loosing list bar and banner
> in
> >> the application. How do I do this?
> >>
> >> thanks,
> >>
> >> Dee
> >
> >
> >.
> >|||It's working. thank you very much.
>--Original Message--
>You will need to use jump to URL action and build the
URL as an expression,
>adding rc:LinkTarget. I know it is not ideal, but it is
the suggested
>workaround for your scenario.
>--
>Bryan Keller
>Developer Documentation
>SQL Server Reporting Services
>A friendly reminder that this posting is provided "AS
IS" with no
>warranties, and confers no rights.
>
>"Deepak" <dee@.discussions.microsoft.com> wrote in message
>news:05b901c46e31$d7519f40$a501280a@.phx.gbl...
>> After giving rc:LinkTarget=framename, second report is
>> opening in a new window. Not in the given frame. I'm
>> using Jump to report method for calling 2nd report.
>> thanks,
>> Deee
>> >--Original Message--
>> >When you access the parent report in your frame, add
the
>> URL access
>> >parameter rc:LinkTarget=framename. This will target
all
>> of the hyperlinks in
>> >the report. You can also do stuff like
>> rc:LinkTarget=_blank to open in a new
>> >window.
>> >
>> >--
>> >Bryan Keller
>> >Developer Documentation
>> >SQL Server Reporting Services
>> >
>> >A friendly reminder that this posting is provided "AS
>> IS" with no
>> >warranties, and confers no rights.
>> >
>> >
>> >"Deepak" <deee@.discussions.microsoft.com> wrote in
>> message
>> >news:02e201c46d7c$f84dff50$a501280a@.phx.gbl...
>> >> Hi,
>> >>
>> >> I've a web application. The default page consists
of
>> >> three frames. 'List bar frame', 'Banner frame'
>> and 'Main
>> >> frame'. Reports are displayed on this 'Main frame'.
>> >> I've a report which has got a column which is
linked to
>> >> another report. I want the second report to be
>> displayed
>> >> in the same frme ('Main frame'). Right now while
>> >> clicking the link column, report is displayed in
the
>> >> parent frame, there by I'm loosing list bar and
banner
>> in
>> >> the application. How do I do this?
>> >>
>> >> thanks,
>> >>
>> >> Dee
>> >
>> >
>> >.
>> >
>
>.
>

Friday, March 9, 2012

How to read the xml returned by select query with "For XML Auto,Elements"

Hi all,

I am writing a select query which produces huge xml data.Now i want to read that data from my web application a save it as xml file.

How can i do that.

I am using asp.net vb.net.

Check if this post is helpful.

http://forums.asp.net/t/1182514.aspx

How to Read The MSDTC LOG.

Hello,
We have an application which uses DTC they are seeing some errors in the
application log and at the same time they want to see if there are any errors
in the MSDTC log but i am not sure how to open the file and with what .it
seems like
text file but when i open it i can't read it .is there anything i should do
Thanks ....
The log file is encrypted and the format is not publicly
available. The files are just used by DTS to manage
transactions and aren't really meant for viewing outside of
what the service itself reads and uses.
Errors with the service itself should show up in the windows
event logs. You may also want to check the RPC service and
make sure you don't have any errors with that as DTS depends
on and uses this service. Overall though, you may be better
off posting the errors you are seeing and going from there.
-Sue
On Thu, 18 Nov 2004 13:49:13 -0800, "chinn"
<chinn@.discussions.microsoft.com> wrote:

>Hello,
>We have an application which uses DTC they are seeing some errors in the
>application log and at the same time they want to see if there are any errors
>in the MSDTC log but i am not sure how to open the file and with what .it
>seems like
>text file but when i open it i can't read it .is there anything i should do
>Thanks ....
|||Oops...those references should be DTC not DTS.
-Sue
On Thu, 18 Nov 2004 17:12:55 -0700, Sue Hoegemeier
<Sue_H@.nomail.please> wrote:
[vbcol=seagreen]
>The log file is encrypted and the format is not publicly
>available. The files are just used by DTS to manage
>transactions and aren't really meant for viewing outside of
>what the service itself reads and uses.
>Errors with the service itself should show up in the windows
>event logs. You may also want to check the RPC service and
>make sure you don't have any errors with that as DTS depends
>on and uses this service. Overall though, you may be better
>off posting the errors you are seeing and going from there.
>-Sue
>On Thu, 18 Nov 2004 13:49:13 -0800, "chinn"
><chinn@.discussions.microsoft.com> wrote:

How to Read The MSDTC LOG.

Hello,
We have an application which uses DTC they are seeing some errors in the
application log and at the same time they want to see if there are any errors
in the MSDTC log but i am not sure how to open the file and with what .it
seems like
text file but when i open it i can't read it .is there anything i should do
Thanks ....The log file is encrypted and the format is not publicly
available. The files are just used by DTS to manage
transactions and aren't really meant for viewing outside of
what the service itself reads and uses.
Errors with the service itself should show up in the windows
event logs. You may also want to check the RPC service and
make sure you don't have any errors with that as DTS depends
on and uses this service. Overall though, you may be better
off posting the errors you are seeing and going from there.
-Sue
On Thu, 18 Nov 2004 13:49:13 -0800, "chinn"
<chinn@.discussions.microsoft.com> wrote:
>Hello,
>We have an application which uses DTC they are seeing some errors in the
>application log and at the same time they want to see if there are any errors
>in the MSDTC log but i am not sure how to open the file and with what .it
>seems like
>text file but when i open it i can't read it .is there anything i should do
>Thanks ....|||Oops...those references should be DTC not DTS.
-Sue
On Thu, 18 Nov 2004 17:12:55 -0700, Sue Hoegemeier
<Sue_H@.nomail.please> wrote:
>The log file is encrypted and the format is not publicly
>available. The files are just used by DTS to manage
>transactions and aren't really meant for viewing outside of
>what the service itself reads and uses.
>Errors with the service itself should show up in the windows
>event logs. You may also want to check the RPC service and
>make sure you don't have any errors with that as DTS depends
>on and uses this service. Overall though, you may be better
>off posting the errors you are seeing and going from there.
>-Sue
>On Thu, 18 Nov 2004 13:49:13 -0800, "chinn"
><chinn@.discussions.microsoft.com> wrote:
>>Hello,
>>We have an application which uses DTC they are seeing some errors in the
>>application log and at the same time they want to see if there are any errors
>>in the MSDTC log but i am not sure how to open the file and with what .it
>>seems like
>>text file but when i open it i can't read it .is there anything i should do
>>Thanks ....

How to Read The MSDTC LOG.

Hello,
We have an application which uses DTC they are seeing some errors in the
application log and at the same time they want to see if there are any error
s
in the MSDTC log but i am not sure how to open the file and with what .it
seems like
text file but when i open it i can't read it .is there anything i should do
Thanks ....The log file is encrypted and the format is not publicly
available. The files are just used by DTS to manage
transactions and aren't really meant for viewing outside of
what the service itself reads and uses.
Errors with the service itself should show up in the windows
event logs. You may also want to check the RPC service and
make sure you don't have any errors with that as DTS depends
on and uses this service. Overall though, you may be better
off posting the errors you are seeing and going from there.
-Sue
On Thu, 18 Nov 2004 13:49:13 -0800, "chinn"
<chinn@.discussions.microsoft.com> wrote:

>Hello,
>We have an application which uses DTC they are seeing some errors in the
>application log and at the same time they want to see if there are any erro
rs
>in the MSDTC log but i am not sure how to open the file and with what .it
>seems like
>text file but when i open it i can't read it .is there anything i should do
>Thanks ....|||Oops...those references should be DTC not DTS.
-Sue
On Thu, 18 Nov 2004 17:12:55 -0700, Sue Hoegemeier
<Sue_H@.nomail.please> wrote:
[vbcol=seagreen]
>The log file is encrypted and the format is not publicly
>available. The files are just used by DTS to manage
>transactions and aren't really meant for viewing outside of
>what the service itself reads and uses.
>Errors with the service itself should show up in the windows
>event logs. You may also want to check the RPC service and
>make sure you don't have any errors with that as DTS depends
>on and uses this service. Overall though, you may be better
>off posting the errors you are seeing and going from there.
>-Sue
>On Thu, 18 Nov 2004 13:49:13 -0800, "chinn"
><chinn@.discussions.microsoft.com> wrote:
>

How to read the DBCC page through cleint application

Hi,
I am writing a application that require to read some DBCC Pages.
But when I execute dbcc page command through ADO, I get a page in terms of e
rror collection.
In that error collection each row of output is just a string.
I need to interpret that string value.
Is there some other way through which I can read DBCC Page.
I am interseted only in the memory dump portion of the page.
Is there some better way to read the data base page or I need to use this er
ror collection method only.
Any help is appreciated.
Thanks
PushkarHi
You may want to use DBCC BYTES but you will have to calculate the starting
address. Ken Henderson's "The Guru's Guide to Transact-SQL" ISBN
0-201-61576-2 gives some information on all these undocumented calls and
using them in production code carries the usual health warnings.
John
"Pushkar" wrote:

> Hi,
> I am writing a application that require to read some DBCC Pages.
> But when I execute dbcc page command through ADO, I get a page in terms of
error collection.
> In that error collection each row of output is just a string.
> I need to interpret that string value.
> Is there some other way through which I can read DBCC Page.
> I am interseted only in the memory dump portion of the page.
> Is there some better way to read the data base page or I need to use this
error collection method only.
> Any help is appreciated.
> Thanks
> Pushkar|||I believe that you can add WITH TABLERESULTS to get back a resultset instead
a string (messages).
Note: It is not supported or documented (but nor is DBCC PAGE, so you are on
your own anyhow :-) ).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Pushkar" <pushkartiwari@.gmail.com> wrote in message news:%23x6XXvsvFHA.1256
@.TK2MSFTNGP09.phx.gbl...
Hi,
I am writing a application that require to read some DBCC Pages.
But when I execute dbcc page command through ADO, I get a page in terms of e
rror collection.
In that error collection each row of output is just a string.
I need to interpret that string value.
Is there some other way through which I can read DBCC Page.
I am interseted only in the memory dump portion of the page.
Is there some better way to read the data base page or I need to use this er
ror collection method
only.
Any help is appreciated.
Thanks
Pushkar|||Thanks, I think this will solve my problem.
Pushkar
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OG8y%23h4vFHA.464@.TK2MSFTNGP15.phx.gbl...
>I believe that you can add WITH TABLERESULTS to get back a resultset
>instead a string (messages). Note: It is not supported or documented (but
>nor is DBCC PAGE, so you are on your own anyhow :-) ).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Pushkar" <pushkartiwari@.gmail.com> wrote in message
> news:%23x6XXvsvFHA.1256@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I am writing a application that require to read some DBCC Pages.
> But when I execute dbcc page command through ADO, I get a page in terms of
> error collection.
> In that error collection each row of output is just a string.
> I need to interpret that string value.
> Is there some other way through which I can read DBCC Page.
> I am interseted only in the memory dump portion of the page.
> Is there some better way to read the data base page or I need to use this
> error collection method only.
> Any help is appreciated.
> Thanks
> Pushkar
>

How to read return value from sqlpipe send(string) method

Hi guys,
How can i read in my C# client application values returned from sqlpipe send(string)/send(reader method from CLR stored procedure.....following is example of a stored procedure.I want to read datetime string in my C# client
Thanks
[Microsoft.SqlServer.Server.SqlProcedure]
public static void PrintToday()
{
// Put your code here
SqlPipe p;
p = SqlContext.Pipe;
p.Send(System.DateTime.Today.ToString());
}

Hi!

Execute your PrintToday with SqlCommand.ExecuteReader, then read the string from SqlDataReader returned.

|||Exactly how are you supposed to do this? No matter what i do, the reader is always empty.

How to read return value from sqlpipe send(string) method

Hi guys,
How can i read in my C# client application values returned from sqlpipe send(string)/send(reader method from CLR stored procedure.....following is example of a stored procedure.I want to read datetime string in my C# client
Thanks
[Microsoft.SqlServer.Server.SqlProcedure]
public static void PrintToday()
{
// Put your code here
SqlPipe p;
p = SqlContext.Pipe;
p.Send(System.DateTime.Today.ToString());
}

Hi!

Execute your PrintToday with SqlCommand.ExecuteReader, then read the string from SqlDataReader returned.

|||Exactly how are you supposed to do this? No matter what i do, the reader is always empty.

Wednesday, March 7, 2012

How to read Exchange server mail attachments

Hi,
I am building an application which reads attatchments from the same
Exchange server where this application runs , and select the data from that
attachment and purge it to database. Can any \one help me with sample code
regards Ar
As far as I ran out of credits with my galss spehere, there is no way for us
to suggest what kind of connection method you are using (MAPI,etc.) or what
coding language you use ?
You should feed us with further information...
Jens Smeyer.
"Lara" <aneeshattingal@.hotpop.com> schrieb im Newsbeitrag
news:ePScgh%23PFHA.2356@.TK2MSFTNGP14.phx.gbl...
> Hi,
> I am building an application which reads attatchments from the same
> Exchange server where this application runs , and select the data from
> that
> attachment and purge it to database. Can any \one help me with sample code
> regards Ar
>
>
|||Hi,
Thaxs fro your reply. I haven't started coding yet.planning to do it in
C#. So can u send me some code samples
*** Sent via Developersdex http://www.codecomments.com ***

How to read Exchange server mail attachments

Hi,
I am building an application which reads attatchments from the same
Exchange server where this application runs , and select the data from that
attachment and purge it to database. Can any \one help me with sample code
regards ArAs far as I ran out of credits with my galss spehere, there is no way for us
to suggest what kind of connection method you are using (MAPI,etc.) or what
coding language you use ?
You should feed us with further information... :)
Jens Süßmeyer.
"Lara" <aneeshattingal@.hotpop.com> schrieb im Newsbeitrag
news:ePScgh%23PFHA.2356@.TK2MSFTNGP14.phx.gbl...
> Hi,
> I am building an application which reads attatchments from the same
> Exchange server where this application runs , and select the data from
> that
> attachment and purge it to database. Can any \one help me with sample code
> regards Ar
>
>

How to read Exchange server mail attachments

Hi,
I am building an application which reads attatchments from the same
Exchange server where this application runs , and select the data from that
attachment and purge it to database. Can any \one help me with sample code
regards ArAs far as I ran out of credits with my galss spehere, there is no way for us
to suggest what kind of connection method you are using (MAPI,etc.) or what
coding language you use ?
You should feed us with further information...
Jens Smeyer.
"Lara" <aneeshattingal@.hotpop.com> schrieb im Newsbeitrag
news:ePScgh%23PFHA.2356@.TK2MSFTNGP14.phx.gbl...
> Hi,
> I am building an application which reads attatchments from the same
> Exchange server where this application runs , and select the data from
> that
> attachment and purge it to database. Can any \one help me with sample code
> regards Ar
>
>|||Hi,
Thaxs fro your reply. I haven't started coding yet.planning to do it in
C#. So can u send me some code samples
*** Sent via Developersdex http://www.codecomments.com ***

How to read block of rows from database tables

have created a Database Application in Java and display all the records in tabular format of one Table. This table have Millions of Rows, If I run Select * from Table, then my Machine not responding, so Now I wants to add paging of 1000 rows at one time.

Is there are any option/query to read block of rows at one time and then query again for next page ?

i.e In MYSQL have LIMIT clause with Select Statement

Please let me know..

Database : SQL Server 2000/2005,

Thanks in Advance
Laxmilal

Whenever you use Select statement you must use WHERE condition to limit the rows.

Eg.

Select col1,col2.... From Tablename WHERE someid between 1 and 1000

Madhu

|||

You 'Machine not responding' is most likely due to waiting for millions of rows to come back from the server.

You really need to limit the quantity of data that you are requesting from SQL Server. Without WHERE clause criteria that enforces limits, you are unnecessarily wasting bandwidth (and time) as more data than you need for the operation at hand is being transported to the client application.

With SQL 2005, you may wish to explore using the new ROW_NUMBER() function to assist in retrieving specific 'blocks' of rows.

Referring to Books Online, Topic: ROW_NUMBER()

Example:

USE AdventureWorks; GO

WITH OrderedOrders AS ( SELECT SalesOrderID, OrderDate, ROW_NUMBER() OVER (ORDER BY OrderDate) AS 'RowNumber' FROM Sales.SalesOrderHeader ) SELECT * FROM OrderedOrders WHERE RowNumber BETWEEN 50 AND 60;(You should be able to adapt this concept for your needs.)

How to read a single row in a strongly types dataset?

I'm using strongly typed datasets in my first ASP.NET 2.0 web application. I come from ASP Classic, not an earlier version of .NET, and feel like I'm in another world. I'm slowly getting my head around datasets, but one thing I can't find any information on is how to read the data in a single record?

I'm not talking about for next loops, or accessing row information as a repeater or other control is filled. I'm talking about reading the data returned by a method that returns a table containing a single record. This is what I have:

Dim BookAdapter As New BooksTableAdapters.BooksBBTableAdapter
Dim organizations As Books.BooksBBDataTable
Dim organization As Books.BooksBBRow

organizations = BookAdapter.GetDataByOneBook(sBookID)

Dim sDropOff As String
Dim sOrganization As String
Dim sContact
For Each organization In organizations
If organization.DropOff = 1 Then
sDropOff = "True"
Else
sDropOff = "False"
End If
sOrganization = organization.Organization
sContact = organization.ContactName
Next

sBody = "Books Listing" & Chr(10) & Chr(10)
sBody = sBody & "Organization: " & sOrganization & Chr(10)
sBody = sBody & "Contact Name: " & sContact & Chr(10)
sBody = sBody & "Email: " & organization.Email & Chr(10)
sBody = sBody & "Phone Number: " & organization.Phone & Chr(10)

I'm using the FOR NEXT, but this is silly since I only have one record. GetDataByOneBook(sBookID) does exactly what is says, it returns a single book with a specific bookID.

Not only is this silly, it doesn't work. Using sContact as an example, it's Dim'd as a string. In the FOR NEXT loop, organization.ContactName has the right value, and it appears to be assigned to sContact correctly, but when I try to use sContact in sBody, I get an error saying that sContact has been used before it is assigned a value. Maybe the variables lose their scope outside the loop? Maybe I could get around this by building sBody inside the loop, but there has to be a better way!

Diane

I believe you want to do something like the following with your code:

1Dim BookAdapterAs New BooksTableAdapters.BooksBBTableAdapter2Dim organizationsAs Books.BooksBBDataTable3Dim organizationAs Books.BooksBBRow45 organizations = BookAdapter.GetDataByOneBook(sBookID)67If (organizations.Count > 0)Then89 sBody ="Books Listing" & Chr(10) & Chr(10)10 sBody = sBody &"Organization: " & organizations[0].Organization & Chr(10)11 sBody = sBody &"Contact Name: " & organizations[0].ContactName & Chr(10)12 sBody = sBody &"Email: " & organizations[0].Email & Chr(10)13 sBody = sBody &"Phone Number: " & organizations[0].Phone & Chr(10)1415End If
I do not have your XSD, so I can not test this.
|||

Thank you!

Diane

Sunday, February 19, 2012

How to query lock contention

Is there a way to query SQL 2000 to find out about table/database lock
contention. I have an application that is getting locked out many times a
day. I can see using "sp_who2" that various spids are being blocked by
others, which in turn are blocked by another...
If I "kill" the top level spid the system frees. I would like to find out
what table that process was locking or holding onto that was causing the
other workstations to hang. Are there any statistics or tools that would
help me?
TIA
MarkTry the stored procedure sp_lock
--
Thanks
Ravi
"Mark Butler" wrote:

> Is there a way to query SQL 2000 to find out about table/database lock
> contention. I have an application that is getting locked out many times a
> day. I can see using "sp_who2" that various spids are being blocked by
> others, which in turn are blocked by another...
> If I "kill" the top level spid the system frees. I would like to find out
> what table that process was locking or holding onto that was causing the
> other workstations to hang. Are there any statistics or tools that would
> help me?
> TIA
> Mark
>
>

How to query lock contention

Is there a way to query SQL 2000 to find out about table/database lock
contention. I have an application that is getting locked out many times a
day. I can see using "sp_who2" that various spids are being blocked by
others, which in turn are blocked by another...
If I "kill" the top level spid the system frees. I would like to find out
what table that process was locking or holding onto that was causing the
other workstations to hang. Are there any statistics or tools that would
help me?
TIA
Mark
Try the stored procedure sp_lock
Thanks
Ravi
"Mark Butler" wrote:

> Is there a way to query SQL 2000 to find out about table/database lock
> contention. I have an application that is getting locked out many times a
> day. I can see using "sp_who2" that various spids are being blocked by
> others, which in turn are blocked by another...
> If I "kill" the top level spid the system frees. I would like to find out
> what table that process was locking or holding onto that was causing the
> other workstations to hang. Are there any statistics or tools that would
> help me?
> TIA
> Mark
>
>