Advertisement

05.21.2008 at 02:46AM PDT, ID: 23420114
[x]
Attachment Details

SQL Update: Update 1 table with info from another table

Asked by jisalazar in MS SQL Server, SQL Query Syntax

Tags: MS, SQL 2000

Hello:

I'd like to create a stored procedure that does the following:
Updates 1 field in 1 table with info from another table in another database based on 1 criterion.
example:
select * from [cegewf].[cege].dbo.[cgrutas_t] (info to update from)
update db_ordenes_compra.f_entr_ruta (field to update to)
where cod_rut=pedido.
This table "db_ordenes_compra" may have more than one record with the same number in "pedido", but I want them all to get updated.

How can I do this?
Thanks.

Joseph
Start Free Trial
[+][-]05.21.2008 at 03:07AM PDT, ID: 21613438

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MS SQL Server, SQL Query Syntax
Tags: MS, SQL 2000
Sign Up Now!
Solution Provided By: Chrisedebo
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.21.2008 at 03:36AM PDT, ID: 21613559

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 03:38AM PDT, ID: 21613574

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628