Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie-do i need multiple updates queries to update multiple tables? 1

Status
Not open for further replies.

azarcomp

Programmer
Joined
Jul 9, 2010
Messages
11
Location
US

Ok, well I am trying to narrow it down before I start coding it for the development app, this is not the dev tables or data.just trying to see if someone thinks i am on the right track.

now I am trying to figure out if the only and best wat to update into 2 or more tables at the same time is to use 2 or more update queries.

like so:
1.make the updates for each table
update Customersset Name = 'TwinBob'where customerId = 1;update dbo.addressset Street = 'newstreet Rd'where CustomerID = 1

--Below select just to view my update changes--select c.CustomerID,c.Name,a.AddressID,a.Street from Customers c left join address aon c.CustomerID = a.CustomerID

am I on the right track???

2. Then make parameters for each column of each table and make the whole batch a stored procedure (T-sql).

3. Then in VB.net pass the vales of columns to be updated to the stored proc from vb.net.

Thanks VERY much in advance
 
thanks, some times you just would like some reinforcement before you spend a couple hours using the wrong approach to begin with. thank!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top