Popular Column DEFAULT Definitions

  • Is there a collection of rock-solid column DEFAULT definitions for the more popular defaults; ie., next sequential number, a random number, current datetime, set to zero, ... ?

  • I use:

    dfZero - 0

    dfOne - 1

    others as needed (I have neede dfThree)

    dfBlank - space(1)

    dfGetDate - getdate()

    dfGUID - newid()

    Sequential - use identity or UDF

    Random - use a UDF, will get better results.

    Steve Jones

    sjones@sqlservercentral.com

    http://www.sqlservercentral.com/columnists/sjones

  • Are the items prefixed with df predefined in the SQL Server system, or do you have to define them first (if so, where do you define them in SQL Server)?

    Also, my posting is requesting the actual code for a User Defined Function for all the defaults so that I can cut n paste, and then move on to less mundane topics.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply