Loading a file within sqlcmd after connection | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Loading a file within sqlcmd after connection

Hello Suppose that I enter in the Command Prompt the following command >sqlcmd -E
After I entered the command, I can type instructions to the server. I would like to know if I can open an script file once I am already connected to the server (not using sqlcmd -E -iScript.sql). Thanks a lot.
You can use -i option, remember OSQL or ISQL in previous versions it is similar.
Check latest books online for SQL 2005 for such code examples. Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.
I don’t think you can open the file to run but you can open a file to read using windows commands… ex: once you connected…
!!type c:oot.int
MohammedU.
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.

You may take help of :r in this case. Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.
]]>