How effective are macros in SQL server?what are macros ?|||There are no macros in sql server. Use stored procedures instead, and they are very effective.|||user defineded functions are also available. UDFs can return a table, inline or scalar result.|||User-defined functions are usefull, but they can only be used for returning data and can't change, create, or delete existing data. Procedures are the best format for automating tasks.
blindman|||Not all macros are used to change data!
A function can change data in a table, remember that you can use the EXECUTE statment in a function.|||You cannot use EXECUTE within a function to change data.
From Books Online:
"User-defined functions cannot be used to perform a set of actions that modify the global database state. "
The database would choke if you invoked a function in a query against a table that could potentially simultaneously change data in the table.
You'll get this message when you call the function:
"Only functions and extended stored procedures can be executed from within a function."
blindman
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment