Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What are the pre-defined functions in the sql server?

1026


How to drop an existing table?

955


How do I schedule a sql server profiler trace?

911


How to access the deleted record of an event?

971


Why we use the openxml clause?

951


what is the difference between writing data to mirrored drives versus raid5 drives. : Sql server administration

910


What are the new features are introduced in sql server 2012 reporting services?

143


How to get a list of columns using the "sys.columns" view in ms sql server?

917


What is difference between joins and subqueries?

1045


how would you store your query in an SSRS report or a Database server?

152


Explain primary key in sql server?

970


Explain about analysis services?

980


Mention the differences between sql server and mysql.

946


What is constraints and its types?

875


What is the maximum size of a dimension? : sql server analysis services, ssas

998