assertions

  • what is the difference between assertion and the check constraint as both of them do the same function?Please give an example

  • Does this help?

    Difference Between Check Constraints and Assertions


    My mantra: No loops! No CURSORs! No RBAR! Hoo-uh![/I]

    My thought question: Have you ever been told that your query runs too fast?

    My advice:
    INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
    The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.

    Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
    Since random numbers are too important to be left to chance, let's generate some![/url]
    Learn to understand recursive CTEs by example.[/url]
    [url url=http://www.sqlservercentral.com/articles/St

  • actually before posting here I did the same research but couldnt clear my doubt..So please give a simpler version of explaination

  • mehta.saurabhj (2/8/2013)


    what is the difference between assertion and the check constraint as both of them do the same function?Please give an example

    Maybe there's something that I'm missing but Assertions and check constraints do not do the same function.

    What makes you say they do?

    ---------------------------------------------------------------
    Mike Hahn - MCSomething someday:-)
    Right way to ask for help!!
    http://www.sqlservercentral.com/articles/Best+Practices/61537/
    I post so I can see my avatar :hehe:
    I want a personal webpage 😎
    I want to win the lotto 😀
    I want a gf like Tiffa :w00t: Oh wait I'm married!:-D

  • I said similar not the same functions!!

  • mehta.saurabhj (2/8/2013)


    I said similar not the same functions!!

    No, you said same:

    mehta.saurabhj (2/8/2013)


    what is the difference between assertion and the check constraint as both of them do the same function?Please give an example

  • No i said similar have a look you idiot!!!

  • mehta.saurabhj (2/8/2013)


    No i said similar have a look you idiot!!!

    Really???? Look again at your first post, I quoted it in mine.

    Your statement from your original post, emphasis is mine:

    what is the difference between assertion and the check constraint as both of them do the same function?Please give an example

  • mehta.saurabhj (2/8/2013)


    No i said similar have a look you idiot!!!

    This is a professional site and this is totally uncalled for.

  • Lynn Pettis (2/8/2013)


    mehta.saurabhj (2/8/2013)


    No i said similar have a look you idiot!!!

    This is a professional site and this is totally uncalled for.

    I completely agree. If he's here to get help, he really know's how to appeal to our generous side. 😀

    ---------------------------------------------------------------
    Mike Hahn - MCSomething someday:-)
    Right way to ask for help!!
    http://www.sqlservercentral.com/articles/Best+Practices/61537/
    I post so I can see my avatar :hehe:
    I want a personal webpage 😎
    I want to win the lotto 😀
    I want a gf like Tiffa :w00t: Oh wait I'm married!:-D

  • OMG! I've worked with SQL Server for over 10 years and I've never heard of assertions. Really. This is the first time I hear there is something like that in SQL Server. Maybe I am the idiot :w00t:

  • Mike Seattle (2/8/2013)


    OMG! I've worked with SQL Server for over 10 years and I've never heard of assertions. Really. This is the first time I hear there is something like that in SQL Server. Maybe I am the idiot :w00t:

    Neither SQL Server, Oracle Nor MYSQL support Assertions either;

    it think this is one of those Things Celko thought was great in theory and injected into some obscure ANSI standard, but noone else thought it worthy, and ignored implementing it.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Mike Seattle (2/8/2013)


    OMG! I've worked with SQL Server for over 10 years and I've never heard of assertions. Really. This is the first time I hear there is something like that in SQL Server.

    While there are asserts in SQL, they are not something that you can create, they're a query plan operator only, so unless you spend time diving into query plans, you'll never see them.

    Assertions are more commonly associated with front end languages, as in

    http://msdn.microsoft.com/en-us/library/system.diagnostics.debug.assert%28v=vs.100%29.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • mehta.saurabhj (2/8/2013)


    what is the difference between assertion and the check constraint as both of them do the same function?Please give an example

    mehta.saurabhj (2/8/2013)


    I said similar not the same functions!!

    mehta.saurabhj (2/8/2013)


    No i said similar have a look you idiot!!!

    If we were going to vote for who on this thread is most deserving of having their intelligence questioned, I know who I would choose.

  • Good comeback, Potsie.

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

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