1、說(shuō)明:創(chuàng)建數(shù)據(jù)庫(kù)
CREATE
DATABASE
database
-
name
2、說(shuō)明:刪除數(shù)據(jù)庫(kù)
drop
database
dbname
3、說(shuō)明:備份sql
server
---
創(chuàng)建 備份數(shù)據(jù)的 device
USE
master
EXEC
sp_addumpdevice
'disk'
,
'testBack'
,
'c:mssql7backupMyNwind_1.dat'
---
開(kāi)始 備份
BACKUP
DATABASE
pubs
TO
testBack
4、說(shuō)明:創(chuàng)建新表
create
table
tabname(col1
type1 [
not
null
]
[
primary
key
],col2
type2 [
not
null
],..)
根據(jù)已有的表創(chuàng)建新表:
A:
create
table
tab_new
like
tab_old
(使用舊表創(chuàng)建新表)
B:
create
table
tab_new
as
select
col1,col2…
<code class="sql keyword" style="white-space:pre-wrap; border:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; line-height:1.8em!important; margin:0px!important; outline:0px!important; overflow:visible!important; padding:0px!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; width:auto!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; min-height:inherit!important; color:rgb(0,0,255)!important; background:none!import