Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to populate PK automatically from Stored Procedure
Message
From
26/09/2002 08:39:15
 
 
To
25/09/2002 18:29:59
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00704506
Message ID:
00704626
Views:
24
You cannot set the default to be the return value of a stored procedure. In fact, the convention is that the return value of the stored procedure should reflect the status of the stored procedure's execution.

A User Defined Function might work, although I've never tried it.

Is there any reason that you're not using IDENTITY values for your PKs?

-Mike

>Hi,
>
>In SQL Server, is it possible to define the default of a field to be the return value of a stored procedure? For example how can I say that the default value of field CustomerPK is SP_MyNewId().
>
>TIA,
>
>Alex
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform