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
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 sqlcmd: change db then run sql file

Author  Topic 

chedderslam
Posting Yak Master

223 Posts

Posted - 2011-01-18 : 17:21:20
Is there a way to run a "use" command against the db and then run a sql file in one command?

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-01-18 : 17:23:19
Are you talking about the sqlcmd command line utility, or SQLCMD mode is SSMS?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-01-18 : 17:23:32
Just put the database name in the sqlcmd command.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -