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
Explain transaction server auto commit?
What is data source in connection string?
What is an etl file?
What is for xml in sql server?
Can we use where clause with group by?
What is normalization according to you and explain its different levels?
What is the language structure to add a record to a table?
What do you understand by coalesce in sql server?
If we delete pack Spec what will be the status of pack Body ?
What are different types of replication in sql server?
What are the different types of data sources in ssrs?
John exports information periodically from a microsoft sql server database to an oracle database what is the best way to do this?
What is mssql?
What is an indexed view?
What is sub query and its properties?