2011年1月30日 星期日
2011年1月29日 星期六
sqlcmd3
sqlcmd -S tcp:127.0.0.1,1433 -q "select @@version"
C:\Documents and Settings\caution>sqlcmd -S tcp:127.0.0.1,1433
1> use hostmonitor
2> select * from hmlog
1> use testdb
2> go
已將資料庫內容變更為 'TestDB'。
1> insert into table_1 values(1,2,3)
2> go
1> insert into table_1 values(null,2,3)
2> go
(1 個受影響的資料列)
1> insert into table_1 values(default,2,3)
2> go
(1 個受影響的資料列)
1> select * from table_1
2> go
sn name address
---------- ---------- ----------
0x00000000 2 3
0x00000000 2 3
(2 個受影響的資料列)
sqlcmd -S tcp:127.0.0.1,1433 -i input.sql
C:\DOCUME~1\caution>mode con: cp select=950
C:\DOCUME~1\caution>type input.sql
use testdb
select * from table_1
C:\DOCUME~1\caution>sqlcmd -S tcp:127.0.0.1,1433 -i input.sql -o output.txt
C:\DOCUME~1\caution>type output.txt
已將資料庫內容變更為 'TestDB'。
sn name address
---------- ---------- ----------
0x00000000 2 3
0x00000000 2 3
(2 個受影響的資料列)
C:\DOCUME~1\caution>
C:\Documents and Settings\caution>sqlcmd -S tcp:127.0.0.1,1433
1> use hostmonitor
2> select * from hmlog
1> use testdb
2> go
已將資料庫內容變更為 'TestDB'。
1> insert into table_1 values(1,2,3)
2> go
1> insert into table_1 values(null,2,3)
2> go
(1 個受影響的資料列)
1> insert into table_1 values(default,2,3)
2> go
(1 個受影響的資料列)
1> select * from table_1
2> go
sn name address
---------- ---------- ----------
0x00000000 2 3
0x00000000 2 3
(2 個受影響的資料列)
sqlcmd -S tcp:127.0.0.1,1433 -i input.sql
C:\DOCUME~1\caution>mode con: cp select=950
C:\DOCUME~1\caution>type input.sql
use testdb
select * from table_1
C:\DOCUME~1\caution>sqlcmd -S tcp:127.0.0.1,1433 -i input.sql -o output.txt
C:\DOCUME~1\caution>type output.txt
已將資料庫內容變更為 'TestDB'。
sn name address
---------- ---------- ----------
0x00000000 2 3
0x00000000 2 3
(2 個受影響的資料列)
C:\DOCUME~1\caution>
sqlcmd2
1> use testdb
2> go
已將資料庫內容變更為 'TestDB'。
1> insert into table_1 values(1,2,3)
2> go
1> insert into table_1 values(null,2,3)
2> go
(1 個受影響的資料列)
1> insert into table_1 values(default,2,3)
2> go
(1 個受影響的資料列)
1> select * from table_1
2> go
sn name address
---------- ---------- ----------
0x00000000 2 3
0x00000000 2 3
(2 個受影響的資料列)
2> go
已將資料庫內容變更為 'TestDB'。
1> insert into table_1 values(1,2,3)
2> go
1> insert into table_1 values(null,2,3)
2> go
(1 個受影響的資料列)
1> insert into table_1 values(default,2,3)
2> go
(1 個受影響的資料列)
1> select * from table_1
2> go
sn name address
---------- ---------- ----------
0x00000000 2 3
0x00000000 2 3
(2 個受影響的資料列)
訂閱:
文章 (Atom)