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

What do you mean by tablesample?

1070


What is a unique key constraint?

1022


What command must you use to include the not null constraint after a table has already been created?

1137


How to create a stored procedure with a statement block in ms sql server?

1063


How to create a simple table to test triggers in ms sql server?

971


How to get the definition of a trigger back?

995


1)what is the difference between Reinitializing a Subscription and synchronization the subscription? 2)when to use reinitializing ? 3)when to use synchronization? 4)when adding table or deleting a table what to do?(reinz.. or syn) 5)when adding a column what to do?

2099


Define tool Manage Statistics in SQL Server 2000 query ?

1079


What is the maximum size of a dimension? : sql server analysis services, ssas

1036


What are the different type of replication in sql server?

976


What is sharding?

116


Explain the use of keyword with encryption. Create a store procedure with encryption?

951


SQL Server Architecture ?

2443


How to change parameter value inside the report?

164


How do users use Report Builder with SQL Server data sources?

154