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
what is normalization? Explain different levels of normalization? : Sql server database administration
What is the partitioning method?
How adventureworkslt tables are related?
What is the size of transaction log file?
How can you insert null values in a column while inserting the data?
What is sql server programming?
Explain how to send email from sql database?
What are the security related catalog views? : sql server security
Tell me time data type, datetime2, datetimeoffset data type in sql server 2008?
What is the difference between join and inner join?
Explain the flow of creating a cube? : sql server analysis services, ssas
How will you monitor replication latency in transactional replication? : sql server replication
What are the types of dml?
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?)
What is the ‘fillfactor’?