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 is the use of keyword with encryption. Create a store procedure with encryption?

899


What types of Joins are possible with Sql Server?

1055


What are the default system databases in sql server 2000?

961


Do you know what is sql service broker?

994


Describe the functionalities that views support.

1049


Explain what are the events recorded in a transaction log?

935


How is table type constraint applied to a table?

932


What are the basic functions for master, msdb, model, tempdb and resource databases? : SQL Server Architecture

948


What is stored procedures?

954


What is the purpose of grouping data in a report?

904


What is ddl and dml commands?

846


How do I find the default sql server instance?

902


How do you set a trace flag in sql server?

995


What is implicit cursors?

998


Explain the ways to controlling cursor behavior?

869