September 26, 2007 at 7:03 am
This is my script pretty simple right.
CREATE PROC sp_UdateWipBinLocations
AS
Update dbo.WipJobAllMat
Set dbo.WipJobAllMat.Bin = dbo.InvWarehouse.DefaultBin
Where dbo.InvWarehouse.StockCode = dbo.WipJobAllMat.StockCode
and dbo.WipJobAllMat.Job = dbo.WipMaster.Job
and dbo.WipMaster.Complete <> 'Y'
and dbo.WipMaster.JobClassification = '90'or dbo.WipMaster.JobClassification = '96'
GO
all the tables are correct in syntax as well as column names
here are the Error msgs:
Msg 4104, Level 16, State 1, Procedure sp_UdateWipBinLocations, Line 3
The multi-part identifier "dbo.InvWarehouse.StockCode" could not be bound.
Msg 4104, Level 16, State 1, Procedure sp_UdateWipBinLocations, Line 3
The multi-part identifier "dbo.WipMaster.Job" could not be bound.
Msg 4104, Level 16, State 1, Procedure sp_UdateWipBinLocations, Line 3
The multi-part identifier "dbo.WipMaster.Complete" could not be bound.
Msg 4104, Level 16, State 1, Procedure sp_UdateWipBinLocations, Line 3
The multi-part identifier "dbo.WipMaster.JobClassification" could not be bound.
Msg 4104, Level 16, State 1, Procedure sp_UdateWipBinLocations, Line 3
The multi-part identifier "dbo.WipMaster.JobClassification" could not be bound.
Please help
September 26, 2007 at 7:16 am
Update dbo.WipJobAllMat
Set dbo.WipJobAllMat.Bin = dbo.InvWarehouse.DefaultBin
FROM dbo.InvWarehouse
INNER JOIN dbo.WipMaster ON dbo.WipJobAllMat.Job = dbo.WipMaster.Job
Where dbo.InvWarehouse.StockCode = dbo.WipJobAllMat.StockCode
and dbo.WipJobAllMat.Job = dbo.WipMaster.Job
and dbo.WipMaster.Complete <> 'Y'
and dbo.WipMaster.JobClassification = '90'or dbo.WipMaster.JobClassification = '96'
Lowell
September 26, 2007 at 7:36 am
I really appreciate the help on this I am being split between one Division and another and trying to pull TSQL from the back of my brain from College while still trying to Manage another division at the same time here I agree theory and practical application are 2 different things.
could you maybe help once more here is the modified code:
CREATE PROC sp_UdateWipBinLocations
AS
Update dbo.WipJobAllMat
Set dbo.WipJobAllMat.Bin = dbo.InvWarehouse.DefaultBin
FROM dbo.InvWarehouse
INNER JOIN dbo.WipMaster ON dbo.WipJobAllMat.Job = dbo.WipMaster.Job
Where dbo.InvWarehouse.StockCode = dbo.WipJobAllMat.StockCode
and dbo.WipJobAllMat.Job = dbo.WipMaster.Job
and dbo.WipMaster.Complete <> 'Y'
and dbo.WipMaster.JobClassification = '90'or dbo.WipMaster.JobClassification = '96'
GO
But I am still getting this one error and it is spelled corretly.
Msg 4104, Level 16, State 1, Procedure sp_UdateWipBinLocations, Line 3
The multi-part identifier "dbo.WipJobAllMat.Job" could not be bound.
Thanks for the help so far it is appreciated,
R
September 26, 2007 at 8:32 am
Keep track of your operator presedence!
UPDATE wjam
SET wjam.Bin = iw.DefaultBin
FROM dbo.WipJobAllMat AS wjam
INNER JOIN dbo.InvWarehouse AS iw ON iw.StockCode = wjam.StockCode
INNER JOIN dbo.WipMaster AS wm ON wm.Job = wjam.Job
WHERE wm.Complete <> 'Y'
AND wm.JobClassification IN ('90', '96')
N 56°04'39.16"
E 12°55'05.25"
September 26, 2007 at 11:57 am
Thanks to all.
I for got to add dbo.WipJobAllMat in the FROM
CREATE PROC sp_UdateWipBinLocations
AS
Update dbo.WipJobAllMat
Set dbo.WipJobAllMat.Bin = dbo.InvWarehouse.DefaultBin
FROM dbo.InvWarehouse, dbo.WipJobAllMat
INNER JOIN dbo.WipMaster ON dbo.WipJobAllMat.Job = dbo.WipMaster.Job
Where dbo.InvWarehouse.StockCode = dbo.WipJobAllMat.StockCode
and dbo.WipJobAllMat.Job = dbo.WipMaster.Job
and dbo.WipMaster.Complete <> 'Y'
and dbo.WipMaster.JobClassification = '90'or dbo.WipMaster.JobClassification = '96'
GO
Now works perfect.
Thanks again to all,
R
September 26, 2007 at 1:50 pm
it is a bad Idea to MIX old syntax with ANSI joins.
* Noel
September 27, 2007 at 1:46 pm
Also, you named named the procedure sp_ which in has special meaning. Is this in the MASTER database? Is this really what you want?
In general, you do this only when you need to call this procedure from multiple databases.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply