How to SELECT stored procedures from SQL Server 2000   Leave a comment


SELECT name, type, syscomments.colid --, text
FROM sysobjects
LEFT JOIN syscomments
ON syscomments.id = sysobjects.id
WHERE type IN('P','FN','V')
AND category = 0
ORDER BY name, syscomments.colid

Yeah … really. The `text` column will have the content of the stored procedures, but it might be split across multiple rows. I think it goes; `colid=1` will be the first, `colid=2` will be the second … yeah.

Now you can backup your stored procs to Hg! Isn’t it great learning stuff?

Advertisements

Posted September 16, 2010 by grigoriipechorin in SQL Server

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: