Showing posts with label Script. Show all posts
Showing posts with label Script. Show all posts
Tuesday, April 16, 2013
Sunday, March 31, 2013
Sql Server 2008,2012: Run Sql Script File From Command Line
To Start Sql Command reform following link:
http://msdn.microsoft.com/en-us/library/ms166559(v=sql.105).aspx
Run the following command in the command prompt.
Replace "C:\myScript.sql" with the location of your sql code file location.
[code language="sql"] sqlcmd -S myServer\instanceName -i C:\myScript.sql[/code]
The above command will return the result set in command prompt.
If you prefer the result in a text file use the code below:
[code language="sql"] sqlcmd -S myServer\instanceName -i C:\myScript.sql -o C:\EmpAdds.txt[/code]
Happy Coding :)
http://msdn.microsoft.com/en-us/library/ms166559(v=sql.105).aspx
Run the following command in the command prompt.
Replace "C:\myScript.sql" with the location of your sql code file location.
[code language="sql"] sqlcmd -S myServer\instanceName -i C:\myScript.sql[/code]
The above command will return the result set in command prompt.
If you prefer the result in a text file use the code below:
[code language="sql"] sqlcmd -S myServer\instanceName -i C:\myScript.sql -o C:\EmpAdds.txt[/code]
Happy Coding :)
Labels:
2008,
2012,
Command Line,
File,
microsoft,
Microsoft Technologies,
Run,
Script,
sql,
Sql Server
Subscribe to:
Posts (Atom)