Running scripts in SQL Server 2005

Tags:
SQL Server 2005
SQL Server Scripts
How can I run scripts in SQL Server 2005?

Answer Wiki

Thanks. We'll let you know when a new response is added.

There are several methods you are use. The easiest and most common would be to open the SQL Server Management Studio on the server or your workstation and open the file in that. This is the native editor for editing SQL Server scripts. Then click on the Execute button at the top, or press the F5 key, <CTRL> X, or <CTRL> E. This will run the script against what ever SQL Server you are connected to.

You can also run scripts from the command line by using the sqlcmd command line utility and passing it either the script via the -Q or -q switches (they are different) or the -i switch to give it a file to get the script from.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Kkavi
    Can you explain the last paragraph clearly. Thanks! Kavi
    10 pointsBadges:
    report
  • carlosdl
    This should help: sqlcmd Utility Tutorial
    70,220 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following