Default empty string

  • Greetings!

    I'd like to put a default empty string in string columns so I can make those columns "Not Null". I tried ' ' in the default line to no avail. How would I do that?

    Thanks,

    SMK

  • What I do sometimes is create a User Defined Data type of SQLEmpty (or whatever naming convention is used). Define it as ' ', then use that for the defaults.

    Quand on parle du loup, on en voit la queue

  • USE tempdb

    CREATE TABLE #t

    (

     c1 VARCHAR DEFAULT ''

    )

    INSERT INTO #t DEFAULT VALUES

    SELECT * FROM #t

    DROP TABLE #t

    works for me. However, I think you're doing this with EM. In that case, you might need to place some () around the ''.

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Wow thanks, Frank. That did it. It's usually the little things like that that consume great quantities of time.

    SMK

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

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