Showing posts with label perform. Show all posts
Showing posts with label perform. Show all posts

Monday, March 12, 2012

servers

We are creating a newServer grabbing data from an extrnal data source.

We need to perform regular audits to verify the record counts (for now) are the same.

We have 2 physically separate SQL servers 1 with old 1 with new.

I have created a linked server but when i do a query on the linked server the performace is pathetic (2mins 12 secs) to do a simple count.

Is there a better way, or can improv the perf?

Thanks
Greg CSomething is grieviously broken, but I don't have enough information to tell you what is broken or how it should be fixed.

The first step would be to attempt the same query the new server using Query Analyzer. The purpose of this step is to determine if the problem lies in the connection between the two machines or within the SQL Server itself. If the query runs poorly in Query Analyzer, then the problem is in the connection between the machines (something is impeding SQL communications between them). If the query runs acceptably in Query Analyzer but does not using the linked server, then the problem is in the linked server.

-PatP|||Yep thanks, field i was counting wasnt indexed.. thanks|||That would be what we call a "bad thing" for lack of a better term! I'm glad to know that the answer was so simple.

-PatP

Wednesday, March 7, 2012

server to Text Files: is possible to detect changes made to those files? (SQL Server 2005

Hi gurus,

I've created a linked server (and set up the corresponding schema.ini file) in order to perform bulk-inserts from some CSV text files into SQL tables (from my standpoint the text files are just for reading purposes). The linked server works fine (I can select the data in the files without a problem).

Now the question: is possible to automatically detect when one or more of those files change in order to start the import process automatically? Something like having a trigger created on the CSV files Or there's no easy way to do that so I have, to say something, to create a Job that periodically checks if the files have changed programatically (say, recording each file's timestamp everytime is imported and comparing the recorded value with the current one, or whatever)?

Thanks a lot in advance!

I think it is not that kind of trigger... so for detecting changes I have some ideeas :

1.Probably there is something in WMI (see ) that let you detect modified data of your file; then compare it with a witness data that reside in SQL and import the file if there is a difference

2.Save the csv files with a name that include data ( 09_04_2007_20_23_12.csv) then in a SSIS package verify all that files ( with "for each loop container control flow item" vis-a-vis a witness data of last import and the import with data flow task.

The checking of new files should be made periodically in a job.