//Execute
sqlcmd -S [Your Sql server name] -U [User_ID] -P [Password] -i [Full_path_of_sql_file_that_will_be_executed]
ex-
sql file name > - D:\main_20150108.sql
Server name > ABC-PC
User Id > sa
Password > System@123
Output file > D:\main_20150108.txt
//Now open Command prompt using ADMINISTRATOR account
C:\Administrator\systerm32> sqlcmd -S ABC-PC -U sa -P System@123 -i D:\main_20150108.sql
//Execute and get in text file
sqlcmd -S [Your Sql server name] -U [User_ID] -P [Password] -i [Full_path_of_sql_file_that_will_be_executed] -o [full_path_of_output_file_after_sql_executed]
C:\Administrator\systerm32> sqlcmd -S ABC-PC -U sa -P System@123 -i D:\main_20150108.sql -o D:\main_20150108.txt
sqlcmd -S [Your Sql server name] -U [User_ID] -P [Password] -i [Full_path_of_sql_file_that_will_be_executed]
ex-
sql file name > - D:\main_20150108.sql
Server name > ABC-PC
User Id > sa
Password > System@123
Output file > D:\main_20150108.txt
//Now open Command prompt using ADMINISTRATOR account
C:\Administrator\systerm32> sqlcmd -S ABC-PC -U sa -P System@123 -i D:\main_20150108.sql
//Execute and get in text file
sqlcmd -S [Your Sql server name] -U [User_ID] -P [Password] -i [Full_path_of_sql_file_that_will_be_executed] -o [full_path_of_output_file_after_sql_executed]
C:\Administrator\systerm32> sqlcmd -S ABC-PC -U sa -P System@123 -i D:\main_20150108.sql -o D:\main_20150108.txt
No comments:
Post a Comment