要把使用的存储过程导出来,查了一下数据库有三十多条,那要导到什么时候,就随手写了一个游标,很简单
DECLARE getProcText CURSOR
FOR select name from sysobjects where xtype='p' and crdate like '%2005%' and left(name,2)='pr'
DECLARE @name varchar(20)
OPEN getProcText
FETCH NEXT FROM getProcText INTO @name
WHILE (@@fetch_status <> -1)
BEGIN
IF (@@fetch_status <> -2)
BEGIN
-- eg.
select text from syscomments where id =object_id(@name)
END
FETCH NEXT FROM getProcText INTO @name
END
CLOSE getProcText
DEALLOCATE getProcText
GO
FOR select name from sysobjects where xtype='p' and crdate like '%2005%' and left(name,2)='pr'
DECLARE @name varchar(20)
OPEN getProcText
FETCH NEXT FROM getProcText INTO @name
WHILE (@@fetch_status <> -1)
BEGIN
IF (@@fetch_status <> -2)
BEGIN
-- eg.
select text from syscomments where id =object_id(@name)
END
FETCH NEXT FROM getProcText INTO @name
END
CLOSE getProcText
DEALLOCATE getProcText
GO
不过导出来都加了提示语和横线,不是我想要的,没办法随手写了一个导出程序,不说了跟上面思路是样的。