Is it possible to create tables in stored procedures using
a variable for the table name?

Answers were Sorted based on User's Feedback



Is it possible to create tables in stored procedures using a variable for the table name?..

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

Is it possible to create tables in stored procedures using a variable for the table name?..

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

Post New Answer

More SQL Server Interview Questions

How to receive returning result from a query?

1 Answers  


what is sql injection?

2 Answers  


What is surrogate key? : sql server analysis services, ssas

1 Answers  


What is full outer join in sql server joins?

1 Answers  


What is compound operators?

1 Answers  


What is replication with database mirroring? : sql server database administration

1 Answers  


How to know the NAME of the Database and SIZE of the Database at the client node in Sql Server 2005

1 Answers  


How many columns can exist together per table?

1 Answers   Cap Gemini,


What is SubQuery in SQL Server 2008

1 Answers   HCL,


What are the components of dbms?

1 Answers  


What are the types of containers in ssis?

1 Answers  


How do I create a partition table in sql server?

1 Answers  


Categories