Is it possible to create tables in stored procedures using
a variable for the table name?
Answers were Sorted based on User's Feedback
Answer / skybeaver
create proc ShowMeHow
as
declare @Cities table(
AirportCode char(3) not null primary key,
CityName varchar(255) not null
)
insert into @Cities values('LAX', 'Los Angeles')
insert into @Cities values('ORD', 'Chicago')
select * from @Cities
go
Is This Answer Correct ? | 7 Yes | 1 No |
Answer / pradeep
One Can create Table using a variable. As #1 Answer
describe. You can only create a temp (memory) table but can
not create physical table.
It will give an error while attempting to execute : -
Create Table @VariableName( EmpID varchar(10),
EmpNm Varchar(100)
)
Is This Answer Correct ? | 1 Yes | 0 No |
What is the primary use of the model database?
Define the one-to-one relationship while designing tables.
What is built-in function?
Can we write ddl in trigger?
What are commit and rollback in sql?
what are cursors? : Sql server database administration
What is hot add cpu in sql server 2008?
Can you name a few encryption mechanisms in sql server?
What is a trigger in sql server?
Write query to return all rows sql?
What's the difference between DELETE TABLE and TRUNCATE TABLE commands?
what's sql server? : Sql server database administration