2013-05-16 28 views
0
C:\>sqlcmd -S(local) -U(sa) -P(password) -i F:\sql.sql 

HResult 0x3, Level 16, State 1 Named Pipes Provider: Could not open a connection to SQL Server [3]. Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : A network-related or in stance-specific error has occurred while establishing a connection to SQL Server . Server is not found or not accessible. Check if instance name is correct and i f SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.. Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : Login timeout expired.使用sqlcmd.exe

How I resolve this problem 
+1

你們能通過連接.. SSMS? – gbn

+0

http://stackoverflow.com/q/11472346/62576,http://stackoverflow.com/q/12326724/62576 –

+0

你有沒有嘗試過使用這個命令從SQL命令工具? –

回答

0

執行該文件夾此查詢執行SQL腳本窗口 - > system32下,因爲每一個SQL命令在此文件夾中執行

C:\Windows\system32>sqlcmd -S(local) -U(sa) -P(password) -i F:\sql.sql