Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / DB Engine / SQL Server / July 2008

Tip: Looking for answers? Try searching our database.

query error, multi-part identifier could not be bound

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Janis Rough - 10 Jul 2008 21:21 GMT
I added a company_type field to the COMPANY table and deleted the
MANUFACTURER table to normalize the database.  Now I need to put the
comp_id in the CAR table in place of the man_id. If the man_id in
Manufacturer = the man_id in CAR then put the comp_id value in the
field called man_id (really the comp_id of type manufacturer).  So I
eliminated the need for a manufacturer table. I wrote to fix the data
but I get an error.
---query to change man_id to comp_id

update internal_car
set internal_car.man_id = internal_manufacturer_temp.comp_id
where
INTERNAL_car.man_id = internal_manufacturer_temp.man_id;

--error---
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "internal_manufacturer_temp.man_id" could
not be bound.
---

Here is my create table for manufacturer:
CREATE TABLE INTERNAL_MANUFACTURER_temp(
man_id smallint  Primary key,
 comp_id smallint

);

INSERT INTO INTERNAL_MANUFACTURER_temp (man_id, comp_id) VALUES
(4, 378);
INSERT INTO INTERNAL_MANUFACTURER_temp (man_id, comp_id) VALUES
(5, 415);
INSERT INTO INTERNAL_MANUFACTURER_temp (man_id, comp_id) VALUES
(6, 416);
INSERT INTO INTERNAL_MANUFACTURER_temp (man_id, comp_id) VALUES
(7, 417);

Here is my create table CAR

CREATE TABLE[INTERNAL_CAR](
[car_id]int NOT NULL identity (1,1),
[equipment_id]int default NULL,
[aar_id]int default NULL,
[build_date]datetime default NULL,
[insp_date]datetime default NULL,
[man_id]int default NULL,
[tot_weight]int default NULL,
[light_weight]int default NULL,
[load_limit]int default NULL,
[cubic_capacity]int NOT NULL default '0',
[comments]text,
[car_type]varchar(15), CHECK ( car_type IN ('for lease','managed')) ,
 PRIMARY KEY  (car_id),

 UNique(car_id, equipment_id)

thanks,
Plamen Ratchev - 10 Jul 2008 22:02 GMT
You have to specify the source tables in the FROM clause:

UPDATE Internal_car
SET man_id = M.comp_id
FROM Internal_car AS I
JOIN Internal_manufacturer_temp AS M
 ON I.man_id = M.man_id;

HTH,

Plamen Ratchev
http://www.SQLStudio.com
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.