Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
310 views

sqlcmd is not recognised as an internal or external command, operable program or batch file SQL2014

I have written an installer that is supposed to install SQL Server Express 2014, create an instance, and then use sqlcmd to connect to the instance and build the database from a schema. It works by, ...
1
vote
1answer
719 views

Copy User Mappings for SQL Logins using SQLCMD - MS SQL Server

Is there a way to directly copy the User Mapping from one SQL Server login to another using SQLCMD? In SQL Server Management Studio Object Explorer | (local) | Security | Logins, Right-Click a user ...
0
votes
1answer
3k views

SqlCmd : Login timeout expired from localhost

I've setup the instance SQLEXPRESS via SQL Server 2008 R2 installation, added a security login with all server roles, one called 'sqluser'. The server authentication is SQL Server and Windows ...
3
votes
1answer
2k views

How to delete MSSQL database using sqlcmd

I have multiple databases created by POCO approach of website building and I want to delete those. However I get error. Command sqlcmd -S .\SQLEXPRESS -q "drop database aspnet-ORData-20120910180110" ...
0
votes
1answer
910 views

sqlcmd backup script failing

I'm trying to use a simple batch script to backup a local instance of SQL Express 2012, as follows: @echo off SET BACKUP_DIR=E:\BackupData SET SERVER=.\\sqlexpress set dom=%date:~0,2% set ...
0
votes
1answer
260 views

SharePoint Sites go into read-only when SQL Server Backup is running

I have SharePoint 2007. When the database backups run using SQLCMD, SharePoint sites go into read-only. Users can't add anything to the sites and the buttons are grayed out. On the backend the ...
-1
votes
2answers
412 views

Can't connect to SQL Server instance through my app but I can with SqlCmd [closed]

I can't connect my VB app to an SQL Server 2005 instance because "server don't exist or access has been denied" (the Conection String is correct because the app works in other networks and also i ...
0
votes
1answer
192 views

RESTORE HEADERONLY usage for telling differential backups apart from full backups

Using RESTORE HEADERONLY and checking the BackupType column to tell differential and full backups apart, but a little stumped on how to restrict the data that is being returned from the RESTORE ...
1
vote
1answer
194 views

SQLCMD is adding an extra newline before the final batch separator

I am trying to write a batch script to run a bunch of T-SQL scripts I keep in version control. The scripts update objects in the database. The script seems to be working fine. The problem is that when ...
0
votes
1answer
430 views

Having trouble piping between cygwin and sqlcmd

This simple command fails in bash: echo "print 'tsql'" | sqlcmd -E it works correctly in a regular old command prompt. It used to work with previous versions of cygwin. I've also tried inserting ...
1
vote
1answer
2k views

sqlcmd won't execute - Claims Native Client not installed properly

I'm trying to use sqlcmd to execute some SQL scripts. Using a test command with a simple query like: sqlcmd -S HOSTNAME -d MYDATABASE -Q 'SELECT Names FROM Customers' sqlcmd does not appear to make ...
0
votes
1answer
420 views

Why does running SQLCMD sometimes revert to “overwrite mode” every newline

A while back I opened a thread for this on the WinSSHD form, but never followed up until now. I then was able to reproduce this locally via the farmanager console. Very simply, if I start up sqlcmd ...
1
vote
3answers
799 views

Why isn't the backup file created when running sqlcmd from remote machine?

I tried running the sqlcmd from a remote host to do a simple backup of a sql 2008 database. The command goes something like this: sqlcmd -s xxx.xxx.xxx.xx -U username -P some_password -Q "Backup ...
1
vote
1answer
1k views

SQL Server scheduled backup: sqlcmd.exe can't connect

I have a homebrewed backup system for SQL Server 2008 Express on Windows Server 2008. A scheduled task runs a .bat file, which in turns calls sqlcmd.exe to run a .sql file that backs up all of the ...
5
votes
3answers
9k views

Is there a way to run sqlcmd to get query output without showing the number of rows affected?

I am running a simple query in SQL Server 2005 and want it to export to a file via sqlcmd. I was hoping to get the results in a csv format without the headers and the query metadata (how many rows ...
1
vote
1answer
2k views

SQLCMD not recogized despite install of SQL Server Native Client for SQL2008

This little question is part of a much larger issue I am trying to resolve: Does SQLCMD require a separate install or is it included with the Microsoft SQL Server 2008 Native Client (which I just ...
2
votes
2answers
895 views

How can I type a \ in the sqlcmd editor?

According to this kb article on what to do if your user database is gone, it recommends the following three actions sqlcmd –E -S InstanceName –d master 1> ALTER LOGIN SQLLogin WITH ...