Utilizing ms sql temporary table

There are two types of temporary table in ms sql : local and global temporary table. You can read it further about that here and here.

For me, the best thing I found about this is that, this table will be created in tempdb table and it is only for temporary.It will be gone once you close your session. :)

I found out it very useful if I want to do patching or debugging with my data and many more reason for me to use it.

Below are few simple way how you can play around with temp table.

temp1

temp2

temp4

temp5

Well, of course you can do a lot of thing more than this. For example:

temp6

This is just to show how we can utilize the usage of temporary table. :)

If you're new here, you may want to subscribe to my RSS feed or get my latest post directly in your mailbox. Thanks for visiting !

Related Post:
  • SQL : Delete with joining to other table
  • MS-SQL - List trigger in your db.
  • SQL - Not In vs Not Exists
  • Simple DOS command..yet still saves my day.
  • Select count(distinct fieldA) in access



  • Can't find what you are looking for? Go Gooogle...
    Google

    Leave a Reply


    AWSOM Powered