Page 1 of 1

Create stored Proc Without EXEC-ing it ?

Posted: 10 Mar 2009, 14:28
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 ?

Re: Create stored Proc Without EXEC-ing it ?

Posted: 10 Mar 2009, 15:29
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.

Re: Create stored Proc Without EXEC-ing it ?

Posted: 10 Mar 2009, 15:34
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.