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
What functions can a view be used to performed?
What is resource governor?
Explain the etl (extraction, transformation, and loading)?
What is the difference between upgrade and migration in sql server?
Explain what is the use of custom fields in report?
What are the properties of the transaction?
How to reaname table name without using sp_Rename in sql server..?
What are a database and a data warehouse?
Why it is recommended to avoid referencing a floating point column in the where clause?
What are the different ways you can create databases in sql server?
Describe different Processing Modes offered by SSRS?
Explain try...catch with sql server?
We need to perform what steps in the following order to work with a cursor?
How to delete duplicate rows from table except one?
Once setting replication, is it potential to own a publisher as sixty four bit sql server and distributor or subscribers as a thirty two bit sql server?