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

How do I create a stored procedure in dbml?

988


What is right outer join in sql server joins?

1158


What are the steps you should follow to start sql server in single-user mode?

879


What is the difference between a fill factor of 100 and 0?

965


What is the definition for sql server 2000?

1075


What is store procedure? How do they work? When do you use?

919


What are various limitations of the views?

1044


Why would you use sql agent?

1245


What are the basic features of a trigger in ms sql server?

1170


Why use “in” clause in sql server?

1053


How to list all objects in a given schema?

1037


How much is a sql server license?

934


Can sql server be linked with other servers like oracle?

945


What are the limitations in ssrs on sql server express edition?

186


Explain the difference between clustered and non-clustered index?

906