4
votes
1answer
492 views

Executing TSQL script generated from SSMS in SQLCMD. Failing on quotes

I am attempting to deploy a database to a machine by executing a script generated by the "Generate Scripts" tool in SQL Server Management Studio. Here is the command I've issued: sqlcmd -S ...
0
votes
1answer
140 views

Is it possible to generate table with generated data without manual INSERT statements?

Is it possible to use SQLCMD in SQL Server 2008 to create a table and generate data and insert into the table, without manually typing the INSERT statement for each row? Example: Suppose there are ...
0
votes
4answers
460 views

Writing SQL statement in sqlcmd to hide the milliseconds for column type of time

I have a table called testtable that have a column named expire_time of type [time] The problem is that when I type the following in sqlcmd: select * from testtable It will return the following: ...
5
votes
1answer
434 views

Query performance while using sqlcmd [duplicate]

Possible Duplicate: Running queries with SQLCMD vs. Running queries with SSMS I have a number of scripts that query the data from different tables and consequently update them. I have ...
2
votes
1answer
1k views

How to modify a stored procedure using SQLCMD for MS SQL?

Suppose a stored procedure as follows have been created using the Microsoft SQL Management Studio. use testbase go create procedure testtable_pricesmaller @pricelimit money as select * from ...
4
votes
2answers
407 views

Are there any way to stop typing 'go' in sqlcmd?

If I remember correctly, last time Microsoft Sqlcmd require each command to end with ';' and hit Enter key to execute the command. However, currently, we need to type the GO each time to execute the ...
1
vote
1answer
182 views

Database created in sqlcmd but missing in SQL Server Management Studio

I created a database named testbase in sqlcmd in SERVER\MSSQLSERVER. However, I cannot access SERVER\MSSQLSERVER. I also could not find testbase inside the server connection using Microsoft SQL ...
3
votes
1answer
3k views

Why does sqlcmd -Lc not show the local instance?

I have two machines, each with a default instance of SQL Server 2008 installed; each exhibiting a different behavior. On PC1, when I run sqlcmd -Lc, I do not see PC1 in the list of SQL servers on ...
3
votes
1answer
661 views

Restoring SQL Server Database Command Line Error

I have a restore database script in a SQL file, and I'm trying to restore a backup generated from one DB to a new DB (that exists). That SQL file is being executed by SQLCMD on the command line. The ...