清除表: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