How to write stored procedure to update the data in 10
tables
Answer Posted / vaishali
create procedure proc_name
{
@para1 varchar(20),
@para2 varchar(20),
}
AS
Declare @sql varchar(8000)
Set @sql="update table1 set col1='value' where
col2='"+@para1+"'\n"
Set @sql=@sql+ "update table2 set col1='value' where
col2='"+@para2+"'\n"
Exec(@sql)
| Is This Answer Correct ? | 10 Yes | 11 No |
Post New Answer View All Answers
Can we call future method from trigger?
How to define output parameters in stored procedures?
IF more than one Site is accessing the same Database server and I want to move the DB with Minimum down time? How will you do
How to transfer an existing table from one schema to another schema in ms sql server?
Explain transaction server consistency?
Describe triggers features and limitations?
What is a non clustered primary key?
Tell me what is the stuff and how does it differ from the replace function?
Does index slows down insert statements?
Is candidate a key?
What is the purpose of sql profiler in sql server? : sql server database administration
How to run sql server 2005 books online on your local system?
Can we create clustered index on composite key?
Does sql server use t sql?
in the physical file layout, where should the transaction log be stored in relation to the data file? : Sql server administration