Defaults

  • Comments posted to this topic are about the item Defaults

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • Thanks for a good back to basics question ...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • good and easy one ...

    ~ demonfox
    ___________________________________________________________________
    Wondering what I would do next , when I am done with this one :ermm:

  • This was removed by the editor as SPAM

  • Easy one

    Malleswarareddy
    I.T.Analyst
    MCITP(70-451)

  • Thanks for the question - nice and easy way to start the day

    -------------------------------Posting Data Etiquette - Jeff Moden [/url]Smart way to ask a question
    There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
    I would never join a club that would allow me as a member - Groucho Marx

  • There'd have been a few more wrong answers if it weren't for the "select 2" hint...

  • Toreador (11/15/2012)


    There'd have been a few more wrong answers if it weren't for the "select 2" hint...

    Given that the selections only add up to 188%, I don't think everyone's taken the hint :w00t:.

  • I certainly might have had to think about the NULL one if the select 2 hint had not been there - but hopefully not for too long.

  • Thanks Kenneth.

    Good question to brush-up our basics 🙂

    ~ Lokesh Vij


    Guidelines for quicker answers on T-SQL question[/url]
    Guidelines for answers on Performance questions

    Link to my Blog Post --> www.SQLPathy.com[/url]

    Follow me @Twitter

  • Great question. I guess I had to think about it more than some of the others though.

  • Dag-nabbit, that'll teach me to read more carefully. I read it as "how many" and not "which"! Duh. Well at least I got it right in my head. 😉

    Ron

    -----
    a haiku...

    NULL is not zero
    NULL is not an empty string
    NULL is the unknown

  • Good question, and one that not too many of us consider daily. We ought to make note here that DEFAULT has been deprecated in an unspecified future version of SQL Server, so don't get too attached to it 🙂

    Roland Alexander 
    The Monday Morning DBA 
    There are two means of refuge from the miseries of life: music and cats. ~ Albert Schweitzer

  • Thanks for the easy question this morning. 🙂



    Everything is awesome!

  • Roland Alexander STL (11/15/2012)


    We ought to make note here that DEFAULT has been deprecated in an unspecified future version of SQL Server, so don't get too attached to it 🙂

    I think you are confusing default constraints (which are defined in the ANSI standard, and not deprecated) with "default objects" that can be bound to columns or alias data types.

    The ANSI standard DEFAULT constraint is what's used in this question - no seperate object, but a default definition used as a constraint in the table.

    The deprecated feature uses CREATE DEFAULT to create a default obejct, and then calls the stored procedure sp_binddefault to bind it to either a column or an alias data type.

    Reference (hyperlink!): CREATE DEFAULT


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

Viewing 15 posts - 1 through 15 (of 33 total)

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