搜尋此網誌

2011年1月29日 星期六

How To Install / Upgrade / Uninstall Advanced Host Monitor

HostMonitor

KingKong Bruce記事: SQL語法之Insert-Update-Delete三部曲

KingKong Bruce記事: SQL語法之Insert-Update-Delete三部曲

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>

sqlcmd 公用程式

sqlcmd 公用程式

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 個受影響的資料列)

sqlcmd

sqlcmd -S tcp:127.0.0.1,1433 -q "select @@version"
exit

sqlcmd -S tcp:127.0.0.1,1433
1> use hostmonitor
2> select * from hmlog
3> go