Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Running Sql Script

Author  Topic 

Steve2106
Posting Yak Master

183 Posts

Posted - 2010-10-20 : 11:23:09
Hi There,

Can someone point me in the right direction please.
I need to run a sql script but not withing sql server. Can that be done?

If I give you some background.
We have a client that has a web application running over the internet but the system is critical enough that they need a local sytem to be run when there is no internet connection.
My problem is that if they add some records to the local system, when the internet comes back online I need to be able to sync the local database to the live one and then download the live one to make the local one the same. Does that make sense?
I need to be able to do this via an .exe or a .bat file because the client does not want to have to sit there and do this via sql server.

Any ideas?

Thanks for your help.


Steve

X002548
Not Just a Number

15586 Posts

Posted - 2010-10-20 : 11:37:33
sqlcmd

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

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





Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2010-10-21 : 08:09:36
yes, call sqlcmd from bat file. use -i to specify a .sql file to run, or -Q to specify the query on the cmd line directly.

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


elsasoft.org
Go to Top of Page

Steve2106
Posting Yak Master

183 Posts

Posted - 2010-11-02 : 07:32:30
Hi There,

Sorry I have not responded to your posts I have been away for a week.
Thanks for your help, I'll have a go at this.

Best Regards,
Go to Top of Page
   

- Advertisement -