http://www.tech-recipes.com/rx/36947/sql-server-execute-sql-script-using-sqlcmd-command-line/
sqlcmd -S 192.168.23.2 -U sa -P db0014pw -i C:\Users\dell\sql1.sql
SQL1.SQL
USE LKTEST
insert into test values('col11','col21','col21');
insert into test values('col12','col22','col22');
insert into test values('col13','col23','col23');
insert into test values('col14','col24','col24');
insert into test values('col15','col25','col25');
GO
sqlcmd -S 192.168.23.2 -U sa -P db0014pw -i C:\Users\dell\sql1.sql
SQL1.SQL
USE LKTEST
insert into test values('col11','col21','col21');
insert into test values('col12','col22','col22');
insert into test values('col13','col23','col23');
insert into test values('col14','col24','col24');
insert into test values('col15','col25','col25');
GO
No comments:
Post a Comment