views:

30

answers:

2

Hi there, I want to connect to Sql server and running some sql queries. How can i do that? Thank you for helps..

A: 

You really need more detail in your question.

Based on my most common experiences, though, if you're just running some queries and putting the results somewhere, you'd want to create a SSIS (SQL 2k5 or 2k8) or DTS (SQL 2k5 and before) package and either have Windows schedule call the package or call it through your .bat file.

AllenG
You mean SQL 2k and before for DTS.
John Saunders
+2  A: 

Check out the SQLCMD utility:

http://msdn.microsoft.com/en-us/library/ms165702.aspx

Works not only on SQL Server 2008 Express, but also on the full versions, too.

marc_s