Scripting SQL Server Functions

Anything that doesn't fall into the defect or enhancement categories

Scripting SQL Server Functions

Postby Joseph Schrag on Fri May 22, 2009 7:43 pm

I have been using the “Build inserts from Table” template for quite a while and find it extremely handy. I am now trying to expand your template to accomplish some additional tasks. Most I have been able to figure out by looking at other templates and the documentation, but there is one that is giving me trouble. I was wondering if someone could just give me a nudge in the right direction.

The problem is that I don’t know how to distinguish SQL functions from SQL procedures in code. I have implemented code to pull the procedures for the selected db, drop each procedure, and recreate it. However, I have noticed that functions get lumped in with stored procedures and I end up with statements like: “DROP PROCEDURE <Function Name>” which of course cause SQL Server to choke. Is there a property I can look at to help me distinguish between procedures and functions or a way to pull only the procedures and pull the functions separately?
Joseph Schrag
Lurker
 
Posts: 5
Joined: Fri May 22, 2009 7:36 pm

Return to General Questions or Comments

Who is online

Users browsing this forum: No registered users and 0 guests

cron