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

Can sql server 2016 run on windows 7?

962


What is difference between drop truncate and delete?

1146


What is replace and stuff function in sql server?

1107


How do I find the query plan in sql server?

1009


If you lose rights to your sql server instance what are the options to connect to sql server instance? : sql server security

1102


Do you have any idea about the tcl commands?

1010


What are the types of database schema? : sql server analysis services, ssas

1180


Why do you need a sql server?

1166


Name 3 of the features that the sql server built-in function loginproperty performs on standard logins? : sql server security

1128


What is index in an assignment?

992


Benefits of Stored Procedures?

1037


What is dbcc? Give few examples.

1081


How to scale out a federation by Sql statement?

118


How to create database with physical files specified in ms sql server?

1029


How to create prepared statements using odbc_prepare()?

1097