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...

i want to create procedure for create table in sql server
2005

for example

create procedure create_table
@table varchar(20)
as
create @table(
id int,
name char(20)
)
but it will get error
what is solution?

Answer Posted / veeresh kethari

Here is the solution...

create proc CREATE_TABLE
@TableName varchar(50)
as
begin
declare @String nvarchar(max)
set @String='create table '+@TableName +'(ID int,Name
varchar(50))'
execute sp_executesql @String
end

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain transaction server auto commit?

1044


What is data source in connection string?

909


What is an etl file?

957


What is for xml in sql server?

1076


Can we use where clause with group by?

904


What is normalization according to you and explain its different levels?

951


What is the language structure to add a record to a table?

1025


What do you understand by coalesce in sql server?

1071


If we delete pack Spec what will be the status of pack Body ?

1476


What are different types of replication in sql server?

1086


What are the different types of data sources in ssrs?

196


John exports information periodically from a microsoft sql server database to an oracle database what is the best way to do this?

943


What is mssql?

985


What is an indexed view?

960


What is sub query and its properties?

974