Create default in stored procedure

  • I am trying to use a stored procedure to set a new default. If I execute "CREATE DEFAULT dftMyDefault AS '0'" in Quuery Analyzer, it runs fine. But if I use the same syntax in stored procedure, I get the error message saying the syntax was incorrect. Any suggestions? Thanks.

  • You can do it this way....

    create proc abc123 as

    exec('CREATE DEFAULT dftMyDefault AS ''0''')

    Cheers,

    Prakash

    Prakash Heda
    Lead DBA Team - www.sqlfeatures.com
    Video sessions on Performance Tuning and SQL 2012 HA

  • quote:


    You can do it this way....

    create proc abc123 as

    exec('CREATE DEFAULT dftMyDefault AS ''0''')

    Cheers,

    Prakash


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

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