Skip to main content

Questions tagged [sqlcmd]

SQLCMD is Microsoft SQL Server's command line utility that allows you execute T-SQL commands from a command prompt.

3 votes
1 answer
70 views

I've noticed when using "sqlcmd" to connect to SQLServer, the text is cut off when the column is of "text" type and more than 256 characters. I've discovered if I place "-y 0&...
dev4life's user avatar
  • 131
2 votes
2 answers
451 views

I am trying to run an MSSQL script using sqlcmd on Windows 10. The command is something like this: sqlcmd -S "host" -U "user" -P "password" -d "database" -C -i &...
Manngo's user avatar
  • 3,207
0 votes
1 answer
481 views

I have an issue where when I log into SSMS I am not seeing any logins. I am running as an administrator and logging in with SA. It does not matter which account I log in with. I only ever see the two ...
Brandon Oisten's user avatar
1 vote
2 answers
203 views

I am working on SQL server task. I need a sqlcmd result file with complete records with headers. Here is the command and error message below sqlcmd -S [Server_Name] -U [User_Name] -P [Password] -d [...
Yuvaraj's user avatar
  • 11
1 vote
0 answers
180 views

I have a sql script that truncates the table and insert into database from a linked server.Since the server is SQL express I will need to use batch jobs to schedule the jobs. Below is a snippet of the ...
SQL_NoExpert's user avatar
  • 1,117
0 votes
0 answers
373 views

I'm working with a vendor about this, but a supplied script that they have to run to upgrade their software, after running, ruins access to SQLCMD. Before running the script I can open a Command ...
kblair's user avatar
  • 1
0 votes
1 answer
1k views

Similar issue seen here. I am trying to run the following command from SSMS running in SQLCMD mode. :r C:\dev\test scripts\sample.sql But I get the following error: A fatal scripting error occurred. ...
mft25's user avatar
  • 111
0 votes
1 answer
342 views

I've just been granted access to a SQL Server data warehouse and I'm trying to get to grips with sqlcmd. Coming from a Postgres/psql background, I'm used to being able to quickly look up a table ...
Matt's user avatar
  • 291
1 vote
0 answers
1k views

I'm trying to install sql server 2022 on a build machine, and then test that I can connect to that server with sqlcmd. I previously had ODBC driver 17 and was getting errors from that command, so I ...
britzkopf's user avatar
0 votes
1 answer
675 views

This is my code: SET @msg = 'Customer Voice replies.'; SET @query= 'SELECT [column1],[column2] FROM [StagingMX].[dbo].[_CVA] WHERE DATEDIFF(day, [Completion time] ,GETDATE()) = 1 AND [...
Raúl Vélez's user avatar
0 votes
1 answer
175 views

I am using this script to backup database on computer A: sqlcmd -U MyDatabase -P MyPassword -S .\SQLEXPRESS -Q "EXEC sp_BackupDatabases @backupLocation = 'c:\shared', @databaseName='MyDatabase', @...
dafie's user avatar
  • 191
2 votes
2 answers
866 views

The following sqlcmd fails with no error and no output, just returns silently. SQLCMD -U dbuser -d dbname -w 255 -h-1 -P mypassword -S dbserver -Q "ALTER TABLE xyz ADD abcd NUMERIC(1)" -c; ...
Ozair Kafray's user avatar
0 votes
1 answer
183 views

I have a SQL Server that is running under Windows. And I have a Linux client. AFAIK SQLCMD requires "local" (server-related) path to backup files. So the question is - how to specify windows ...
Eldhenn's user avatar
4 votes
2 answers
2k views

I've created a script that outputs data in an XML format, and was using SQL Server Agent (Job Step of Type 'Operating System (cmdexec)') to run a job monthly/quarterly to output the data to a specific ...
Abe Dickenson's user avatar
0 votes
2 answers
3k views

I recently had to uninstall Visual Studio 2012 and DTS, then install VS 2017 and DTS again. Afterwards, The directory containing sqlcmd.exe was not in my PATH variable. I installed the following. ...
lit's user avatar
  • 233

15 30 50 per page
1
2 3 4 5
13