Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 sqlcmd

Author  Topic 

ori_davidson
Starting Member

15 Posts

Posted - 2014-09-19 : 08:18:11
hello,
i'm trying to export a query to a csv file from a batch file.

batch file:
sqlcmd -S loni-sbs -d lonikahn0207 -E -Q "select * from ael" -o "AELORI.csv" -h-1 -s"," -w 700

BUT, I'm getting a user name and password issue inside the csv file:
Cannot open database "lonikahn0207" requested by the login. The login failed.
Msg 18456
Login failed for user 'LONIBOOKS\Administrator'.

ori_davidson
Starting Member

15 Posts

Posted - 2014-09-19 : 08:56:16
i guess that i don't know where to put the -U USER and -P PASSWORD in the command line
Go to Top of Page
   

- Advertisement -