获得存储过程参数信息,程序太慢了,要20多秒解决方法
获得存储过程参数信息,程序太慢了,要20多秒
select sc.name as Parameter,st.name as type,sc.length as length
from syscolumns sc inner join sysobjects so on so.id=sc.id
inner join systypes st on sc.xtype=st.xtype
where so.name='过程名'
------解决方案--------------------
select sc.name as Parameter,st.name as type,sc.length as length
from syscolumns sc inner join sysobjects so on so.id=sc.id
inner join systypes st on sc.xtype=st.xtype
where so.name='过程名'
------解决方案--------------------
- SQL code
SELECT * FROM INFORMATION_SCHEMA.PARAMETERS WHERE specific_name='过程名'
------解决方案--------------------
这没有优化余地了
也许你硬件和网络不好
------解决方案--------------------
- SQL code
--加一个限制条件,so.xtype='P' select sc.name as Parameter,st.name as type,sc.length as length from syscolumns sc inner join sysobjects so on so.id=sc.id inner join systypes st on sc.xtype=st.xtype where so.xtype='p' and so.name='过程名'
------解决方案--------------------
sp_help 存储过程名 得出信息
sp_helptext 存储过程名 得出内容