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 bulkcopy in sql?
How many categories of functions based their return modes?
How to drop an existing user defined function in ms sql server?
Explain optimistic and pessimistic concurrency?
What is replace and stuff function in sql server?
can a database be shrunk with users active? : Sql server administration
What is the use of nvl work?
You want to implement the many-to-many relationship while designing tables. How would you do it?
What is a print index?
hi i am working as a testengineer , so i want to no the backend data base connection can any one tell mwe in detail
Is truncate a dml command?
What are the Advantages of using CTE in sql server?
What is "scheduled jobs" or "scheduled tasks"?
How to override dml statements with triggers?
How to create a local temporary stored procedure?