adspace


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


Please Help Members By Posting Answers For Below Questions

How to remove duplicate rows from table except one?

1096


What is an indexed view?

1030


How can I check that whether automatic statistic update is enabled or not?

1121


What is a scheduled job or what is a scheduled task?

1044


What are the different types of subquery?

1240


What is in place upgrade in sql server?

1137


What are the properties of the transaction?

1084


Does view occupy space?

1033


What are the different subsets of sql?

1662


Can sql servers link to other servers like oracle?

928


What is the difference between for xml raw and for xml auto?

1125


How do I start sql server 2017?

1024


do you know how to configure db2 side of the application? : Sql server database administration

1135


Why should you use or avoid select * statements?

1120


What is sql server query analyzer?

1137