I have been using the MyGeneration's Build inserts from Table template for quite a while and find it extremely handy. I am now trying to expand the 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 dont 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?
Also, two other lesser questions:
Is it possible to script SQL Server jobs in MyGeneration?
Is it possible to script SQL Server logins & their associated DB users in MyGeneration?