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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you pass expressions to function parameters?

1103


What is cached report?

143


How to generate create table script on an existing table in ms sql server?

1144


Explain what are the database objects? : SQL Server Architecture

1084


What is @@error in sql?

1068


How to delete duplicate records based on single column from a table?

1051


Explain boyce and codd normal form(bcnf)?

959


Do you know what is user defined datatypes and when you should go for them?

968


Tell me what is the stuff and how does it differ from the replace function?

981


What is the difference between index seek vs. Index scan?

1023


Differentiate between a having clause and a where clause.

965


What are the default system databases in sql server 2000?

1030


How to loop through result set objects using odbc_fetch_row()?

978


You have to store user responses of ‘yes’ and ‘no’ what kind of data type is best suited for this task?

946


What is spid in sql server profiler?

1108