How to write stored procedure to update the data in 10
tables

Answer Posted / jaipal

CREATE PROCEDURE <<procName>>
(
@param1 varchar(20),
@param2 varchar(20)
)
AS
UPDATE <<tableName1>> SET <<colName1>> = @param1 WHERE
<<colName2>> = @param2

UPDATE <<tableName1>> SET <<colName1>> = @param1 WHERE
<<colName2>> = @param2

..
..
..
..

UPDATE <<tableNameN>> SET <<colName1>> = @param1 WHERE
<<colName2>> = @param2

Is This Answer Correct ?    6 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is factless fact table? : sql server analysis services, ssas

758


How to assign null values to variables or columns?

710


What are the differences between char and varchar in ms sql server?

754


What is the security principal at the database level that represents your session?

702


List some case manipulation functions in sql?

773






What are the different types of columns types constraints in the sql server?

735


Help!!!!!!!!!!!! My database has gone offline, it is highlighted as 'Suspect'. Foolishly, i haven't got a recent back up. Is there a way of quickly restoring the database? Thank you

1477


What is the difference between drop table and truncate table?

656


What is shared lock?

647


How many types of keys are there?

738


what's the information that can be stored inside a bit column? : Sql server database administration

721


What happens if strings are casted into wrong code pages in ms sql server?

824


Explain powershell included in sql server 2008?

764


what method you can use to reduce the overhead of Reporting Services data sources?

202


what are isolation levels? : Sql server database administration

657