|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
execute long sql scriptHi,
I have a very big sql script that I can not opne with Mangement Studio due to the size. What other tool can I use to execute this script? All it has are INSERT statements. Thanks, Ping Read about SQLCMD.exe, a command line tool. E.g.
SQLCMD -S Servername -E -i yourscriptfilepath -o youroutputfilepath RLF Show quoteHide quote "Pingx" <Pi***@discussions.microsoft.com> wrote in message news:69342935-51B9-4BBF-9594-49C49F3537C5@microsoft.com... > Hi, > I have a very big sql script that I can not opne with Mangement Studio due > to the size. > What other tool can I use to execute this script? All it has are INSERT > statements. > > Thanks, > > Ping Thanks Russel.
How about OSQL? Pingx Show quoteHide quote "Pingx" wrote: > Hi, > I have a very big sql script that I can not opne with Mangement Studio due > to the size. > What other tool can I use to execute this script? All it has are INSERT > statements. > > Thanks, > > Ping Pingx (Pi***@discussions.microsoft.com) writes:
> OSQL should work find too. The command line would be same as Russell> Thanks Russel. > How about OSQL? posted. In addition, I would recommend that you use the -I option with both tools. This enables the setting QUOTED_IDENTIFIER which is default with other means of connection, and which is required for some functionality. Less source for confusion this way. -- Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se Links for SQL Server Books Online: SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx Thanks for your help.
Pingx Show quoteHide quote "Erland Sommarskog" wrote: > Pingx (Pi***@discussions.microsoft.com) writes: > > > > Thanks Russel. > > How about OSQL? > > OSQL should work find too. The command line would be same as Russell > posted. > > In addition, I would recommend that you use the -I option with both > tools. This enables the setting QUOTED_IDENTIFIER which is default > with other means of connection, and which is required for some > functionality. Less source for confusion this way. > > > -- > Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se > > Links for SQL Server Books Online: > SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx > SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx > SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx > > Running the insert sql script in SQLCMD is a lot slower than running the same
stateent in Management Studio, Is there any reason why? Ping Show quoteHide quote "Pingx" wrote: > > Thanks for your help. > Pingx > "Erland Sommarskog" wrote: > > > Pingx (Pi***@discussions.microsoft.com) writes: > > > > > > Thanks Russel. > > > How about OSQL? > > > > OSQL should work find too. The command line would be same as Russell > > posted. > > > > In addition, I would recommend that you use the -I option with both > > tools. This enables the setting QUOTED_IDENTIFIER which is default > > with other means of connection, and which is required for some > > functionality. Less source for confusion this way. > > > > > > -- > > Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se > > > > Links for SQL Server Books Online: > > SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx > > SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx > > SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx > > > > Pingx (Pi***@discussions.microsoft.com) writes:
> Running the insert sql script in SQLCMD is a lot slower than running the But you said that you could not run in Mgmt Studio at all?> same stateent in Management Studio, Is there any reason why? I don't see why SQLCMD would be slower. But there is a whole lot you have not told us about, so there could be all sorts of reasons. -- Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se Links for SQL Server Books Online: SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx Do you have SET NOCOUNT ON at the beginning of the script?
-- Show quoteHide quoteAndrew J. Kelly SQL MVP Solid Quality Mentors "Pingx" <Pi***@discussions.microsoft.com> wrote in message news:67355C57-F930-4069-8A46-344EA842E8CF@microsoft.com... > Running the insert sql script in SQLCMD is a lot slower than running the > same > stateent in Management Studio, Is there any reason why? > > Ping > > "Pingx" wrote: > >> >> Thanks for your help. >> Pingx >> "Erland Sommarskog" wrote: >> >> > Pingx (Pi***@discussions.microsoft.com) writes: >> > > >> > > Thanks Russel. >> > > How about OSQL? >> > >> > OSQL should work find too. The command line would be same as Russell >> > posted. >> > >> > In addition, I would recommend that you use the -I option with both >> > tools. This enables the setting QUOTED_IDENTIFIER which is default >> > with other means of connection, and which is required for some >> > functionality. Less source for confusion this way. >> > >> > >> > -- >> > Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se >> > >> > Links for SQL Server Books Online: >> > SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx >> > SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx >> > SQL 2000: >> > http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx >> > >> > you can use vedit
http://www.vedit.com/ Show quoteHide quote "Pingx" wrote: > Hi, > I have a very big sql script that I can not opne with Mangement Studio due > to the size. > What other tool can I use to execute this script? All it has are INSERT > statements. > > Thanks, > > Ping
Other interesting topics
Move SQL2008 Express to another machine
Cannot find a GUI to execute a query SSMS 2008 Super Buggy ODBC Drivers 64-Bit SQL Server Management Studio Server List using table valued function in a update query statistics for performance BCP connect error via shared memory to local instance sql server balnk date SQL Server Profiler and Prepared Queries |
|||||||||||||||||||||||