mssql各种指令集合

清除表:truncate table 【tablename】;

建立存储过程:

create proc procname

as

..

go

建立游标:

declare cursorName cursor for sqlsentence --定义游标

open cursorName--打开游标

fetch next from cursorName into --执行查询

close cursorName--关闭游标

deallocate cursorName --删除游标

 

条件:

IF..ELSE.. END IF

IF(condition) then

else

end if

循环

while (condition)

begin

end

posted @ 2010-08-19 00:52  mylhei  阅读(246)  评论(0编辑  收藏  举报