
SQLServer
SQL语句
黒貓警长
人生最坏的结果也不过只是大器晚成
展开
-
SQL检索在视图或者存储过程中有没有使用当前表
select distinct object_name(id) from syscomments where id in (select id from sysobjects where type in('V','P')) and text like '%表名%'原创 2022-03-24 17:13:53 · 396 阅读 · 0 评论 -
SQLServer存储过程基本语法
存储过程基本语法--判断存储过程是否存在,如果存在了就先删除再创建if (exists (select * from sys.objects where name = 'Pro_User')) drop proc Pro_Usergocreate proc Pro_User as declare @Name varchar(20), @Id varchar(50)begin --逻辑代码 select * from UserInfo where Name=Nam原创 2020-11-23 10:59:29 · 748 阅读 · 0 评论