https://msdn.microsoft.com/en-us/library/ms162773.aspx
I needed to import .SQL file (aka "sql dump") into a local database with the following script:
sqlcmd -S 127.0.0.1 -d MyDatabaseNameHere -U MySqlUserNameHere -P myPasswordGoesHere -a 32767 -i C:\MySqlFile.sql -o "C:\output.txt". I was getting an error message in the output file that login failed.
I get an error message in the output file saying that login failed for user "blah". I tried user name without the domain as well. Same thing. I also tried not using user/password at all thinking it would user Windows auth. And I get a different error message: " The login is from an untrusted domain and cannot be used with Windows authentication.." This is my login and authentication mode on the server is mixed.
Solution was to create another Login in SQL with sysadmin rights.
Then in the cmd use this login
This script populated all the tables in the database. Those tables were originally created from the models (code that I got from source control). https://msdn.microsoft.com/en-us/library/vstudio/dd456815(v=vs.100).aspx
No comments:
Post a Comment