February 18, 2014 at 9:53 pm
Good question Igor, thanks.
---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
February 19, 2014 at 12:30 am
Nice question, thanks.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
February 19, 2014 at 12:31 am
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
February 19, 2014 at 1:25 am
SQLRNNR (2/19/2014)
I wonder how many people have used identity in this way (select into...).
Just one per year!
😉
February 19, 2014 at 1:59 am
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
February 19, 2014 at 3:22 am
This was removed by the editor as SPAM
February 19, 2014 at 3:30 am
nice question Igor. Thanks for sharing
February 19, 2014 at 5:34 am
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.
February 19, 2014 at 5:58 am
Nice question.
I sat there for five minutes staring at it looking for the catch, before deciding that there wasn't one.
Tom
February 19, 2014 at 6:03 am
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
February 19, 2014 at 6:56 am
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
February 19, 2014 at 7:24 am
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.
February 19, 2014 at 7:28 am
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
February 19, 2014 at 11:42 am
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