Monday, June 2, 2008

Connecting to a named instance by using SQLCMD command prompt in Windows Authentication and specifying input and output files

Connecting to a named instance by using SQLCMD command prompt in Windows Authentication and specifying input and output files:

sqlcmd -S \ -i -o

we can execute following command

sqlcmd -S 2282-h9-ing\RAj_LOCAL_SERVER -i SQLQuery1.sql -o result.rpt

where result.rpt , SQLQuery1.sql , SQLCMD utility all are at following location

C:\Program Files\Microsoft SQL Server\90\Tools\Binn

Following link is useful
http://msdn.microsoft.com/en-us/library/ms180944.aspx

No comments: