Collections:
GO - Sending a Statement Batch from "sqlcmd" in SQL Server
How To Use GO Command in "sqlcmd" in SQL Server?
✍: FYIcenter.com
"sqlcmd" is a command line client application to run Transact-SQL statements on a target SQL Server.
When "sqlcmd" is started and connected to a SQL Server, it will start a new batch and prompt you to enter the first statement of the batch. You can enter one or more statements in one or more lines to form a Transact-SQL statement batch.
To end a batch of statements and send it to the SQL Server for execution, you need to enter the GO command. The following "sqlcmd" tutorial session sends two batches to the SQL Server:
C:\>sqlcmd -S localhost\sqlexpress -U sa -P FYIcenter 1> SELECT getdate(); 2> SELECT getdates(); 3> SELECT getdate(); 4> GO Msg 195, Level 15, State 10, Line 2 'getdates' is not a recognized built-in function name. 1> SELECT getdate(); 2> SELECT getdate(); 3> SELECT getdate(); 4> GO ----------------------- 2007-05-19 22:55:07.233 (1 rows affected) ----------------------- 2007-05-19 22:55:07.233 (1 rows affected) ----------------------- 2007-05-19 22:55:07.233 (1 rows affected) 1>QUIT C:\
⇒ Downloading and Installing SQL Server 2005 Books Online in SQL Server
⇐ Running Queries with 'sqlcmd' Tool in SQL Server
⇑ Downloading and Installing SQL Server 2005 Express Edition
2016-12-04, 4373🔥, 0💬
Popular Posts:
How To Use SQL*Plus Built-in Timers in Oracle? If you don't have a stopwatch/timer and want to measu...
How To Convert Binary Strings into Integers in SQL Server Transact-SQL? Binary strings and integers ...
Where to find answers to frequently asked questions on Conditional Statements and Loops in SQL Serve...
How To Get Year, Month and Day Out of DATETIME Values in SQL Server Transact-SQL? You can use DATEPA...
How To Assign Debug Privileges to a User in Oracle? In order to run SQL Developer in debug mode, the...