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 normalization? Explain different levels of normalization? : Sql server database administration

638


What is the partitioning method?

519


How adventureworkslt tables are related?

517


What is the size of transaction log file?

474


How can you insert null values in a column while inserting the data?

700






What is sql server programming?

532


Explain how to send email from sql database?

553


What are the security related catalog views? : sql server security

523


Tell me time data type, datetime2, datetimeoffset data type in sql server 2008?

556


What is the difference between join and inner join?

529


Explain the flow of creating a cube? : sql server analysis services, ssas

609


How will you monitor replication latency in transactional replication? : sql server replication

592


What are the types of dml?

543


Insert syudents details in table.Current system date &time insert into joining time.How do insert?( in sysdate only return current system date how do add time?)

1421


What is the ‘fillfactor’?

556