Top "Sqlcmd" questions

SQLCMD is a command line tool used to run SQL batches on Microsoft SQL Server.

How to set a sqlcmd output to a batch variable?

I'm trying to set the output of a sqlcmd query to a variable in a batch file. Here's my query: …

sql-server batch-file for-loop batch-processing sqlcmd
SQLCMD, command-line variables and script :setvar

When running SQLCMD.exe and providing command-line arguments for scripting variables, I expect that the values provided on the command-line …

sql-server sql-server-2005 sqlcmd
ForEach Property in Get-Member

I have the following snippet of code in my powershell script $sqlHDR = "SELECT * FROM OPENROWSET ('Microsoft.Jet.OLEDB.4.0','Excel 8.0;…

powershell foreach sqlcmd
How do I run a script using a BAT file?

I would like to have a BAT file open a sql server script. Currently I have this code in the …

sql sql-server windows batch-file sqlcmd
Powershell SqlCmd - Using result values without defining variables

I am wondering if there is any way to use values for a dataset in a subsequent query. Here is …

sql variables powershell literals sqlcmd
How to terminate sqlcmd immediately after execution completed?

I create a process in C# to execute sqlcmd /S <servername> /d <dbname> /E /i to …

c# batch-file sqlcmd
sqlcmd output file remove header and footer

Using SQLCMD, I can output the query result to a text file, now, the text file has header: And footer: …

sql-server-2008 sqlcmd
sqlcmd - How to get around column length limit without empty spaces?

I'm trying to use sqlcmd on a windows machine running SQL Server 2005 to write a query to a csv file. …

sql sql-server sqlcmd batch-file
cmd.ExecuteNonQuery value of i integer is going -1 from 0

Here i create table in database dynamically. User enters name as his wish and selects language radiobutton. So problem is …

c# asp.net sqlcmd
Cannot connect to LocalDB via sqlcmd

I am currently learning SQL Server and am having problems connecting to my local database using sqlcmd. When I type …

sql-server database powershell sqlcmd smss