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

Can we call future method from trigger?

889


How to define output parameters in stored procedures?

970


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

1765


How to transfer an existing table from one schema to another schema in ms sql server?

936


Explain transaction server consistency?

930


Describe triggers features and limitations?

936


What is a non clustered primary key?

879


Tell me what is the stuff and how does it differ from the replace function?

945


Does index slows down insert statements?

948


Is candidate a key?

903


What is the purpose of sql profiler in sql server? : sql server database administration

1054


How to run sql server 2005 books online on your local system?

927


Can we create clustered index on composite key?

990


Does sql server use t sql?

969


in the physical file layout, where should the transaction log be stored in relation to the data file? : Sql server administration

1014