Create stored Proc Without EXEC-ing it ?

Get help on databases - MySQL, Oracle, Access, etc.
Post Reply
SBSP
Registered User
Posts: 3124
Joined: 09 May 2006, 02:00
Location: Centurion

Create stored Proc Without EXEC-ing it ?

Post by SBSP »

Hi I have a stored procedure that i need to add to MSQL SQL 2005

We are upgrading to 2005 from SQL 2000

The problem is i have 2 Stored Procs.

Stored Proc1 and FormatProc.

Proc1 executes, and Proc1 executes FormatProc.

FormatProc is there to format a value E.G '000000000.0000000' to '00000000.00' (Something like that)

So obviously Proc1 kind of use FormatProc like a function, passing a value to FromatProc, FormatProc then
modifies the value and results it back to Proc1.

Now i cant seem to add FormatProc to the Stored procedures in the tree view in SQL2005 because when i create
an new stored proc it has to be executed and you cant execute it stand alone as it needs a a value to work with.
So i just get an error when executing it.

In SQL2000 you can add a stored proc even if it will fail to execute, provided that the syntax is all correct.

Does anyone know if this is possible ?
RuadRauFlessa
Registered User
Posts: 20576
Joined: 19 Sep 2003, 02:00
Location: Bloodbank

Re: Create stored Proc Without EXEC-ing it ?

Post by RuadRauFlessa »

Change the proc to a function and you are set. Yes in 2005 you can add functions which will only return a single value. Also what is the code inside the proc. There might be something which 2000 allowed which 2005 does not.
:rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock:
Spoiler (show)
Intel Core i7-2600k @ 3.4GHz
Corsair Vengence 2x4GB DDR3 2000MHz
Thermaltake Toughpower 850W
ASUS nVidia GTX560 1GB
CoolerMaster HAF 932
SBSP
Registered User
Posts: 3124
Joined: 09 May 2006, 02:00
Location: Centurion

Re: Create stored Proc Without EXEC-ing it ?

Post by SBSP »

Actually when i got the Database (Inside a VM it was there) so i deleted it only to realise the Format proc is still the same and does not need upgrading so someone has got it right to put the FormatProc in without executing it.

I can paste the code here but, its a couple of pages long.
Post Reply