SQL批量添加主键脚本(二)
d
end
else
begin
print '当前数据表['+@TableName+']已有主键'
end
--用游标去取下一条记录
fetch next from mycursor1 into @TableName,@TableID
end
--关闭游标
close mycursor1
--撤销游标
deallocate mycursor1
--脚本代码结束