0

When get a .sql file, how do you execute it? Double click to open it and press F5? Is there any other way to execute it and also able to see the execution result. Thanks.

1 Answer 1

3

run the OSQL or SqlCmd tools

for example

osql -D db_name -S server_name -U username -P password -i sqlfile
or
sqlcmd -D db_name -S server_name -U username -P password -i sqlfile

or you can use -E instead of user and password to do integrated security

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.