Showing posts with label advice. Show all posts
Showing posts with label advice. Show all posts

Friday, March 30, 2012

READ_COMMITTED_SNAPSHOT

READ_COMMITTED_SNAPSHOT in 2005 is what I wanted.

However, I am still using 2000. READ_COMMITTED in 2000 is different.

Can anyone give me advice on this issue?

(or there is no way in Sql Server 2000 to handle the following scenario:

Process One

UPDATE tableA SET fieldB = 'testing' WHERE fieldA = 1;

Process Two

SELECT * FROM tableA WHERE fieldA = 1;

While Process One is working, Process Two will fail. But I just want to allow Process Two to read the data (i.e. the version that before Process One is working). This is what READ_COMMITTED_SNAPSHOT do in Sql Server 2005.

)

Thanks for any advice.

Hi Wilson. There is no automatic method to allow this type of read in Sql 2000. You can make use of the read uncommitted isolation level, which will give you dirty reads (in your scenario above process two would read a value of 'testing' for fieldB where fieldA = 1). Of course, using the read committed isolation level in Sql 2000, if the transaction isn't long running, you should still be able to read the data successfully...perhaps we could help you tune the schema a bit to allow for faster read/write access and shorter transaction time instead?

HTH,

Chad

|||

Thanks for your confirmation.

Better to upgrade to Sql Server 2005.

Thanks again.

sql

Monday, March 26, 2012

Read Text file

Hi,

I have the text file in my server.

Is it possible to read that text file and insert into the table.

pls advice

Regards

Antony

SELECT PVListFile.F1 AS mytxt INTO MyTable FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0','Data Source="c:\";User
ID="Admin";Password=;Extended Properties="text;HDR=No"')...filename#txt as PVListFile
|||

Refer to Books Online about using 'BULKINSERT', 'bcp', and/or 'OPENDATASOURCE'.

See this recent thread about using bcp.

sql

Read SQL Profiler Trace output

Hi Folks,

I want to Read the SQL Profiler Trace Output using VB or VB.NET

I read some forums. They advice to import SMO in VB.NET..

But how can i Import this....

This is very Urgent for me....

Please Reply me immediately...You don't need SMO to read trace output. select from ::fn_get_trace into a table, then use normal ADO.Net to access the trace data from the table.|||Thanks for Reply...

Please can u give me a sample code for this....

Please this is very urgent for me...|||

First thing you need to do is set up your trace to go into a file. (Sending the trace data directly into SQL Server is very bad for performance.) Once you've got the trace file you can do something like this (which is right out of Books Online - see that document for more details.)

USE AdventureWorks;

GO

SELECT * INTO temp_trc

FROM fn_trace_gettable('c:\temp\my_trace.trc', default);

GO|||Thanks for help me...

Monday, February 20, 2012

Rather Simple Logic - Need some advice

I have two tables and I want to validate that the results of a query
match the required structure. In this example, the Bad Query returns
two Row2, it therefore does not match the required structure.
Thanks for the help.
Dave
Actual Results from a Query (Good)
---
PartNo Row Description
6F23-1700034-AP32NC 1 V65-F001G
6F23-1700034-AP32NC 2 V65-S002G
6F23-1700034-AP32NC 3 V65-T032G
Actual Results from a Query (Bad)
---
PartNo Row Description
6F23-1700034-AP32NC 1 V65-F001G
6F23-1700034-AP32NC 2 V65-S002G
6F23-1700034-AP32NC 3 V65-T003G
6F23-1700034-AP32NC 2 V65-S002G
Required Structure
--
Row Description
1 1st Row
2 2nd Row
3 3rd RowA precise definition of 'match required structure' is needed to answer your
question.
IF (SELECT COUNT(*) FROM RequiredStructure) =
(SELECT COUNT(*) FROM ActualResults) AND
(SELECT COUNT(*) FROM RequiredStructure) =
(SELECT COUNT(*)
FROM(
SELECT Row FROM RequiredStructure
UNION
SELECT Row FROM ActualResults
) AS CompareResults
)
PRINT 'Matches'
ELSE
PRINT 'Does not match'
Hope this helps.
Dan Guzman
SQL Server MVP
"Dave" <davel@.here.ca> wrote in message
news:r0em72ln86fhtc5b9gammvvn72d2f7h68f@.
4ax.com...
>I have two tables and I want to validate that the results of a query
> match the required structure. In this example, the Bad Query returns
> two Row2, it therefore does not match the required structure.
> Thanks for the help.
> Dave
>
> Actual Results from a Query (Good)
> ---
> PartNo Row Description
> 6F23-1700034-AP32NC 1 V65-F001G
> 6F23-1700034-AP32NC 2 V65-S002G
> 6F23-1700034-AP32NC 3 V65-T032G
> Actual Results from a Query (Bad)
> ---
> PartNo Row Description
> 6F23-1700034-AP32NC 1 V65-F001G
> 6F23-1700034-AP32NC 2 V65-S002G
> 6F23-1700034-AP32NC 3 V65-T003G
> 6F23-1700034-AP32NC 2 V65-S002G
> Required Structure
> --
> Row Description
> 1 1st Row
> 2 2nd Row
> 3 3rd Row
>