asked on
ASKER
ASKER
declare @table table(id int identity ,col int)
insert @table values (91),(10)
select * into #tmp from @table
select * from #tmp
ASKER
ASKER
ASKER
ASKER
CREATE TABLE #TABLEB ( id INT IDENTITY, col1 VARCHAR(10));
INSERT #TABLEB
VALUES ('1st record'),
('2nd record');
IF OBJECT_ID('tempdb..#TableA') IS NOT NULL
BEGIN
INSERT #TABLEA
SELECT col1
FROM #TABLEB
END
ELSE
BEGIN
CREATE TABLE #TABLEA ( col1 VARCHAR(10))
INSERT #TABLEA
SELECT col1
FROM #TABLEB
END
SELECT * FROM #TABLEA
ASKER
ASKER
Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.
TRUSTED BY