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
 Execute a SQL Script

Author  Topic 

nishi57
Starting Member

20 Posts

Posted - 2007-09-11 : 15:55:58
I have couple of SQL Scripts that I want to execute, how do I go about doing that. I have a Windows 2003 server on which SQL Server is installed which includes - SQL Enterprise Manager, as well Query Analyzer is installed. How do I get the script to execute. Any help will be greatly appreciated.

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2007-09-11 : 16:06:06
copy, paste and run?
if you can elaborate more, the answer will be more clear

--------------------
keeping it simple...
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-09-11 : 16:06:29
Connect to the server in Query Analyzer, open the scripts into a window, then hit the green arrow or F5 to execute them.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-09-11 : 16:33:46
use osql in a command window?


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

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2007-09-11 : 16:52:14
You can also create a job and schedule the execution of the script.

Go to Top of Page

nishi57
Starting Member

20 Posts

Posted - 2007-09-11 : 18:50:04
How do i go about creating a job and how do I schedule the execution of the script?

Nishi
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-09-11 : 22:49:57
You can create job under sql server agent -> jobs in enteprise manager, check books online for details.
Go to Top of Page

rams_spl2002
Starting Member

9 Posts

Posted - 2007-09-12 : 06:48:28
quote:
Originally posted by nishi57

I have couple of SQL Scripts that I want to execute, how do I go about doing that. I have a Windows 2003 server on which SQL Server is installed which includes - SQL Enterprise Manager, as well Query Analyzer is installed. How do I get the script to execute. Any help will be greatly appreciated.



rams
Go to Top of Page

rams_spl2002
Starting Member

9 Posts

Posted - 2007-09-12 : 06:51:40
if u want already exisiting script goto enterprise manager right click on ur database and all taskes and then genarate script u fallow the window

rams
Go to Top of Page

nishi57
Starting Member

20 Posts

Posted - 2007-09-12 : 08:20:46
Thank you all for your help.
Go to Top of Page
   

- Advertisement -