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
How do I create a stored procedure in dbml?
What is right outer join in sql server joins?
What are the steps you should follow to start sql server in single-user mode?
What is the difference between a fill factor of 100 and 0?
What is the definition for sql server 2000?
What is store procedure? How do they work? When do you use?
What are various limitations of the views?
Why would you use sql agent?
What are the basic features of a trigger in ms sql server?
Why use “in” clause in sql server?
How to list all objects in a given schema?
How much is a sql server license?
Can sql server be linked with other servers like oracle?
What are the limitations in ssrs on sql server express edition?
Explain the difference between clustered and non-clustered index?