Temp Table Data Types

  • Dave62

    SSCertifiable

    Points: 6224

    Comments posted to this topic are about the item Temp Table Data Types

  • Ron McCullough

    SSC Guru

    Points: 63877

    Nice question .. learned something from it ... thanks

    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]

  • Lokesh Vij

    SSChampion

    Points: 10836

    bitbucket-25253 (3/12/2013)


    Nice question .. learned something from it ... thanks

    +1

    Thanks Dave

    ~ 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

  • demonfox

    SSCertifiable

    Points: 6289

    bitbucket-25253 (3/12/2013)


    Nice question .. learned something from it ... thanks

    +1

    I gotta learn about Select Into ; as I mostly avoid it , I don't pay attention ...

    I guessed for Varchar and Date :w00t:

    time for research 😎

    thanks for the question

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

  • SQLRNNR

    SSC Guru

    Points: 281210

    Nice question.

    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

  • Danny Ocean

    SSCertifiable

    Points: 6098

    demonfox (3/12/2013)


    bitbucket-25253 (3/12/2013)


    Nice question .. learned something from it ... thanks

    +1

    I gotta learn about Select Into ; as I mostly avoid it , I don't pay attention ...

    I guessed for Varchar and Date :w00t:

    time for research 😎

    thanks for the question

    Same here. Good learning. 🙂 !!!

    Thanks
    Vinay Kumar
    -----------------------------------------------------------------
    Keep Learning - Keep Growing !!!
    www.GrowWithSql.com

  • Dineshbabu

    Hall of Fame

    Points: 3220

    One easiest way to avoid this confusion is .. don't use SELECT * INTO.

    Always prefer CREATE TABLE..

    --
    Dineshbabu
    Desire to learn new things..

  • okbangas

    SSChampion

    Points: 11773

    Learned something new here, and by the way, the reference should be:

    Date, Time, and Timestamp Escape Sequences



    Ole Kristian Velstadbråten Bangås - Virinco - Facebook - Twitter

    Concatenating Row Values in Transact-SQL[/url]

  • Carlo Romagnano

    SSC-Insane

    Points: 21667

    okbangas (3/13/2013)


    Learned something new here, and by the way, the reference should be:

    Date, Time, and Timestamp Escape Sequences

    Good!

  • This was removed by the editor as SPAM

  • Raghavendra Mudugal

    SSChampion

    Points: 10658

    Stewart "Arturius" Campbell (3/13/2013)


    Interesting question, thanks Dave

    Another way to check the detail of the temp table would be to execute tempdb..sp_help #TempQoD

    Now this is very very new thing to me... thank you.

    (and for the INTO.. table stuff, I thought it is obvious... like when you use the import/export tool and when you trying to import the data from the excel file it marks all the column as varchar except the first one if there are any number like 1 2 3... it marks as int... and if we need the col type to any specific then the tool allows us to modify the value accordingly. As the source data is like a variant, I thought it will be difficult to sql to pick the exact datatype to meet the source and the destiny.... until proven otherwise. This is very interesting, thank you for posting the question, Dave)

    ww; Raghu
    --
    The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.

  • Raghavendra Mudugal

    SSChampion

    Points: 10658

    Carlo Romagnano (3/13/2013)


    okbangas (3/13/2013)


    Learned something new here, and by the way, the reference should be:

    Date, Time, and Timestamp Escape Sequences

    Good!

    +1

    ww; Raghu
    --
    The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.

  • kapil_kk

    SSC-Insane

    Points: 21316

    Raghavendra Mudugal (3/13/2013)


    Stewart "Arturius" Campbell (3/13/2013)


    Interesting question, thanks Dave

    Another way to check the detail of the temp table would be to execute tempdb..sp_help #TempQoD

    Now this is very very new thing to me... thank you.

    (and for the INTO.. table stuff, I thought it is obvious... like when you use the import/export tool and when you trying to import the data from the excel file it marks all the column as varchar except the first one if there are any number like 1 2 3... it marks as int... and if we need the col type to any specific then the tool allows us to modify the value accordingly. As the source data is like a variant, I thought it will be difficult to sql to pick the exact datatype to meet the source and the destiny.... until proven otherwise. This is very interesting, thank you for posting the question, Dave)

    New thing for me too 🙂

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • kapil_kk

    SSC-Insane

    Points: 21316

    Stewart "Arturius" Campbell (3/13/2013)


    Interesting question, thanks Dave

    Another way to check the detail of the temp table would be to execute tempdb..sp_help #TempQoD

    +1 🙂

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • db4breakfast

    Ten Centuries

    Points: 1097

    Stewart "Arturius" Campbell (3/13/2013)


    Interesting question, thanks Dave

    Another way to check the detail of the temp table would be to execute tempdb..sp_help #TempQoD

    I often use sp_help to get db object info, but never try the query on explanation. That query can be handy since it provides more info about a particular table. Thank Dave!

    Derived on the query on the explanation, this query can be used to object info for other db objects such as trigger and stored procedure.

    USE tempdb;

    go

    SELECT *

    FROM sys.objects o

    LEFT JOIN sys.columns AS c ON c.object_id = o.object_id

    LEFT JOIN sys.types AS t ON t.system_type_id = c.system_type_id

    WHERE o.object_id = object_id('#TempQoD');

    --------------------------------------------------------------------------------------
    Hai Ton
    My Db4Breakfast blog.

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

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