Temp Table in Sql Server

Cursor- Sql Server
Cursor- Sql Server
0
(0)

How to Create Temp Table in Sql Server

 

Check, Drop, Re-Created and Insert in Temp Table
IF OBJECT_ID('tempdb..#CONTACTMASTER') IS NOT NULL
   DROP TABLE dbo.#CONTACTMASTER;

   
CREATE TABLE #CONTACTMASTER(
    PHONENO NVARCHAR(20)
)
CREATE NONCLUSTERED INDEX ix_CONTACTMASTER_PHONENO ON #CONTACTMASTER (PHONENO);


INSERT INTO #CONTACTMASTER
SELECT  PHONE  FROM NEWPHONES 
EXCEPT
SELECT  PHONE  FROM PHONEDIRECTORY

More on Sql Server …

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

1 Trackback / Pingback

  1. Sql Server Interview Questions - etechstuffs

Leave a Reply

Your email address will not be published.


*


2 × 4 =