IDENTITY

  • Comments posted to this topic are about the item IDENTITY

    Igor Micev,My blog: www.igormicev.com

  • Good question Igor, thanks.

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

  • Nice question, thanks.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Nice question. I wonder how many people have used identity in this way (select into...).

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • SQLRNNR (2/19/2014)


    I wonder how many people have used identity in this way (select into...).

    Just one per year!

    😉

  • SQLRNNR (2/19/2014)


    Nice question. I wonder how many people have used identity in this way (select into...).

    It's used in migrations. For example if you have to migrate users from one system to another and want to start the identity from a particular position then it comes in use. There other examples as well.

    Regards,

    Igor

    Igor Micev,My blog: www.igormicev.com

  • This was removed by the editor as SPAM

  • nice question Igor. Thanks for sharing

  • Good question, thanks. It isn't a very common thing to use (at least for me) but it's a handy tool to have when needed.

  • Nice question.

    I sat there for five minutes staring at it looking for the catch, before deciding that there wasn't one.

    Tom

  • TomThomson (2/19/2014)


    Nice question.

    I sat there for five minutes staring at it looking for the catch, before deciding that there wasn't one.

    +1

    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 question. Thanks Igor.

    If you want numbers for your records in a SELECT, why not use:

    ROW_NUMBER ( ) OVER ( <partition_by_clause> <order_by_clause> )

    in the query?

    [font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
    Connect to me on LinkedIn

  • Thomas Abraham (2/19/2014)


    Good question. Thanks Igor.

    If you want numbers for your records in a SELECT, why not use:

    ROW_NUMBER ( ) OVER ( <partition_by_clause> <order_by_clause> )

    in the query?

    Because in the SELECT INTO the created field should be of type INT with attribute IDENTITY.

    ROW_NUMBER creates just an INT.

  • Igor Micev (2/19/2014)


    SQLRNNR (2/19/2014)


    Nice question. I wonder how many people have used identity in this way (select into...).

    It's used in migrations. For example if you have to migrate users from one system to another and want to start the identity from a particular position then it comes in use. There other examples as well.

    Regards,

    Igor

    I use it all the time for various things including migrations. It's a nice trick to have in the bag.;-)

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • bitbucket-25253 (2/19/2014)


    TomThomson (2/19/2014)


    Nice question.

    I sat there for five minutes staring at it looking for the catch, before deciding that there wasn't one.

    +1

    +1 - sometimes simple questions are difficult to answer.

    Thanks for the QotD, Igor!

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

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