Sunday, February 19, 2012

Can I schedule SQL extract using SQL Server Express

I have downloaded almost all file related to SQL Server 2005 Express edition. Before I wast time finding out that what I want to do it not possible afteral.

What I want to is to connect to an SQL Server and extract data from that into my local db (Gues that will be my local SQL server db?) and than pass the data onto MS Access.

My question is: can I automate this procedure I.e. schedule to download and export to Access using the Express Edition.

Appreciate any feedback

Thanks,
BogdanHi Bogdan,
SQL Express does not include the SQL Agent, so it does not support any kind of scheduling for anything. What you can do is create a script that does what you and can be run via SQLCmd. You can then use the Windows Task Scheduler to schedule SQLCmd to run and use the script you created.
This same procedure can be used for any scheduled task you wish to perform when using SQL Express.
Regards,

Mike|||

yes, thanks and this is the code for the batch-file

Rem1 connect SLQ-Server (ServerName = SQLExpress)
Rem2 within command line 'use' is used for selected dB, however directly from prompt it is -d. My db name is 'Bogdan'
Rem3 Select Query to execute (from file) within command line ':r', to activate cmd use -q (or -Q to quit to connection).
Rem4 Execute 'Go' not necessary

sqlcmd -S .\SQLExpress -d Bogdan -Q ":r C:\SQL_Server_Queries\SQL_CreateQuery.sql"
Bogdan

No comments:

Post a Comment