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

Why use stored procedures in sql server?

1025


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

1157


Difference between 2NF &3NF ?

1091


What is replace and stuff function in sql server?

1073


Explain ranking functions?

1055


Where sql server usernames and passwords are stored in a sql server?

994


Difference Between ORDER BY Clause and GROUP BY Clause in SQL?

1068


What is the native system stored procedure to execute a command against all databases?

1038


Can a database be shrunk with users active?

1143


how would you write a sql query to compute a frequency table of a certain attribute involving two joins? What changes would you need to make if you want to order by or group by some attribute? What would you do to account for nulls?

1635


How to find out what is the default collation in a database?

1129


How do I create a partition table in sql server?

1136


Explain about link server in sql server?

1064


Do you know what is difference between index seek vs. Index scan?

959


What is star, snowflake and star flake schema? : sql server analysis services, ssas

1169