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 difference between equi join and natural join?
Why normalization is used?
Define ACID properties in a Database?
Explain basic SQL queries with SELECT from where Order By, Group By-Having?
What happens if you add a new index to large table?
What are group functions in query statements in ms sql server?
List some advantages and disadvantages of stored procedure?
can a database be shrunk with users active? : Sql server administration
Explain different types of index?
How to provide default values to stored procedure parameters?
What is replication and database mirroring?
what is a self join? : Sql server database administration