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 23:40:10
 
 
To
25/09/2002 18:29:59
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00704506
Message ID:
00705066
Views:
13
>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

If you use a GUID as your PK's you can use the NewID() function as the default value. Make sure your data type is Uniqueidentifier. This is the best key type to use with distributed data.

Yes, Mike is correct, you can use a User Defined Function as a default value in SQL 2000.

BOb
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform