Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Explain what are db_options used for?

1 Answers   InterGraph,


What are the basic functions for master, msdb, model, tempdb and resource databases?

0 Answers  


List out a number of the wants to setup a SQL Server failover cluster?

0 Answers  


Define synonym?

0 Answers  


Define cursor locking

0 Answers  


What are some of the pros and cons of not dropping the sql server builtinadministrators group? : sql server security

0 Answers  


Does index speed up select statements?

0 Answers  


What are the types of subscriptions in SQL Server replication?

0 Answers   HCL,


what is memory-optimized nonclustered indexes

0 Answers  


How to list all dsn entries on your local machine using odbc_data_source()?

0 Answers  


Explain collation?

0 Answers  


What is data compression? : sql server database administration

0 Answers  


Categories