How to create a temporary table without first creating columns?
CREATE TABLE #Yaks ( YakID int, YakName char(30) ) select name from tempdb..sysobjects where name like '#yak%' drop table #yaks
First you need to define a table.
Create a table (temp) with the same columns as the other (without copying data):
select * into #TempTable from MyTable where 1=0
Note. No foreign keys, indexes, etc. are created.
Source: https://habr.com/ru/post/1434123/More articles:Atlas Sprite / Texture: GDI + Bitmap.MakeTransparent for a color key with OpenTK - c #Define the site language through a subdomain or subdirectory (es.example.com or www.example.com/es) - urlNodeJS in production - node.jsGet an instance containing the class - reflectionNexmo Incoming Callback URL - javaCheck sentences if they have the same word - sqlAnalyzing nested xml in a denormalized table - sqlRemove Highligthing From Dynatree Checkbox Mode when clicked or Hover - jquerySplit image into interactive areas - javaRequest room reservation in sql - sqlAll Articles