SQL Temp tables
I've used temp table within my SQL when it come to analysis and planning a database change for a live server.
You can create a temp table in a number of ways, but I like to use either the below two.
The best thing with temp tables, they are only created for the query view you are in and the query view sees it as a real table.

New temp custom table
This is when you create the temp table as you would create a real table.

CREATE TABLE #USERLOGGEDIN
(
ID UNIQUEIDENTIFIER,
USERNAME NVARCHAR(50),
NAME NVARCHAR(50),
LOGGEDIN DATETIME
CREATED DATETIME

)


Temp table for a current table
This takes a live table schema and create temp in view memory version.

SELECT top 0 * INTO #USERS FROM USERS

Related Links

Buy me a coffeeBuy me a coffee

Latest blogs

Buy me a coffeeBuy me a coffee
Created: 22/08/2016 Total Comment: 0

Comments

(Not Displayed)
Human validation
Enter 4746 number, before submitting to confirm your human
[Home] [All Blogs] [Contact] [Me]
Buy me a coffeeBuy me a coffee