Pwninstein Pwninstein - 1 year ago 85
SQL Question

Can I create a One-Time-Use Function in a Script or Stored Procedure?

In SQL Server 2005, is there a concept of a one-time-use, or local function declared inside of a SQL script or Stored Procedure? I'd like to abstract away some complexity in a script I'm writing, but it would require being able to declare a function.

Just curious. Thanks!!

Answer Source

You can call CREATE Function near the beginning of your script and DROP Function near the end.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download