Enterprise Resource Planning Blog Posts by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
7,625

For this you can use SQLCMD from the command line as shown below:

## running a proc to update a view eg ##
SQLCMD -S ServerSQL -d SBODemoUS -U sa -P sap123 -Q "EXEC Proc_Name"


## exporting a file as example ##

SQLCMD -S ServerSQL -d SBODemoUS -U sa -P sap123 -Q "SELECT * FROM OITM" -o C:\MyOutput.txt

## Generically you can use the following syntax ##

SQLCMD -S ServerSQL -d SBODemoUS -U sa -P sap123 -Q “Your Query” -s “,” -o C:\MyOutput.csv

Now you can go to your file location and open the file and you will see that new csv file created there. When you open the csv file you will notice the results of the query.

You can use SQLCMD combined with the scheduled task

More information:

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

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

Create a scheduled task in Windows Server 2008

http://www.hosting.com/support/windows-server-2008/create-a-scheduled-task-in-windows-server-2008

How To Schedule Tasks in Windows XP

http://support.microsoft.com/kb/308569

Regards,

Marcelo Silva Santos

1 Comment