Viewing stored procedures
-
Hi All, I was wondering if I could get some advice on this. What Im trying to do is view a stored procedure in an asp page. I dont know much about it and was wondering is it like displaying records in a table? Any help/links would be greatly appreciated. Thanks in advance Nic
-
Hi All, I was wondering if I could get some advice on this. What Im trying to do is view a stored procedure in an asp page. I dont know much about it and was wondering is it like displaying records in a table? Any help/links would be greatly appreciated. Thanks in advance Nic
Assuming you are talking about SQL Server 2000 (You didn't mention a database product - so the rest of this answer may not apply) you can perform a query like this:
select * from syscomments
inner join sysobjects on sysobjects.id = syscomments.id
where xtype='P'Which will return all of the stored procedures and the their uncompiled source. Does this help?
My: Blog | Photos WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
-
Assuming you are talking about SQL Server 2000 (You didn't mention a database product - so the rest of this answer may not apply) you can perform a query like this:
select * from syscomments
inner join sysobjects on sysobjects.id = syscomments.id
where xtype='P'Which will return all of the stored procedures and the their uncompiled source. Does this help?
My: Blog | Photos WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
Or using INFORMATION_SCHEMA:
SELECT ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.Routines
WHERE ROUTINE_CATALOG = 'MyDatabaseName'
AND ROUTINE_NAME = 'MyProcName'MS SQL Server will return NULL if the procedure has been encrypted.