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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

msg 208 invalid object name

Status
Not open for further replies.

Kaiya

Technical User
Feb 27, 2004
12
US
This parses ok, but when i try to execute i get the error:

Invalid object name 'CommerceCenterImport.dbo.p21_view_inv_mast'.
Server: Msg 208, Level 16, State 1, Line 1


SELECT "item_id","item_desc","alternate_code","product_group_id","delete_flag"
FROM "CommerceCenterImport"."dbo.p21_view_inv_mast" inner JOIN "CommerceCenterImport"."dbo"."p21_view_inv_loc" ON "p21_view_inv_mast"."inv_mast_uid"="p21_view_inv_loc"."inv_mast_uid"
,"p21_view_alternate_code" "alternate_code" left outer join "CommerceCenterImport"."dbo"."p21_view_alternate_code" on "p21_view_inv_mast"."inv_mast_uid"="p21_view_alternate_code"."inv_mast_uid"
WHERE "p21_view_alternate_code"."alternate_code" is null AND "p21_view_inv_loc" s >"100004" and "p21_view_inv_mast"."delete_flag"='N'

ORDER BY "p21_view_inv_mast"."item_id", "p21_view_alternate_code"."alternate_code"

Please help! this is driving me nuts [cyclops]

Kaiya
 
CommerceCenterImport.dbo.p21_view_inv_mast

check the spelling - especially Center.

It just means the object doesn't exist.

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Missing quotes:

Code:
SELECT "item_id","item_desc","alternate_code","product_group_id","delete_flag"
 FROM "CommerceCenterImport"."dbo[b]"."[/b]p21_view_inv_mast" inner JOIN "CommerceCenterImport"."dbo"."p21_view_inv_loc" ON "p21_view_inv_mast"."inv_mast_uid"="p21_view_inv_loc"."inv_mast_uid"
,"p21_view_alternate_code" "alternate_code" left outer join "CommerceCenterImport"."dbo"."p21_view_alternate_code" on "p21_view_inv_mast"."inv_mast_uid"="p21_view_alternate_code"."inv_mast_uid"
WHERE  "p21_view_alternate_code"."alternate_code" is null AND "p21_view_inv_loc" s >"100004" and "p21_view_inv_mast"."delete_flag"='N' 

 ORDER BY "p21_view_inv_mast"."item_id", "p21_view_alternate_code"."alternate_code"

Hope that helps

VJ
 
I wanted to highlight this line

FROM "CommerceCenterImport"."dbo"."p21_view_inv_mast"

VJ
 
There's a typo in this line:

FROM "CommerceCenterImport"."dbo.p21_view_inv_mast"

change it to read:

FROM "CommerceCenterImport"."dbo"."p21_view_inv_mast"

-SQLBill
 
Just get rid of all the double quotes.
The identifier delimitter should be [].
The string delimitter should be '.

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Took eveyone's advice and now getting error:

Server: Msg 107, Level 16, State 3, Line 1
The column prefix 'p21_view_inv_mast' does not match with a table name or alias name used in the query.
 
can you pot what you have.
I would avise formatting it

Code:
SELECT 	item_id ,
	item_desc ,
	alternate_code ,
	product_group_id ,
	delete_flag
FROM 	CommerceCenterImport.dbo.p21_view_inv_mast p21_view_inv_mast
	inner JOIN CommerceCenterImport.dbo.p21_view_inv_loc p21_view_inv_loc 
		ON p21_view_inv_mast.inv_mast_uid = p21_view_inv_loc.inv_mast_uid
	inner join ....
where 	...
and	...
and	...
order by 
	p21_view_inv_mast.item_id ,
	p21_view_alternate_code.alternate_code

My first attempt at code tags :)


======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
this is how it is currently set up. is this what you wanted to see?

SELECT item_id,item_desc,alternate_code,product_group_id,delete_flag
FROM CommerceCenterImport.dbo.p21_view_inv_mast inner JOIN CommerceCenterImport.dbo.p21_view_inv_loc ON p21_view_inv_mast.inv_mast_uid=p21_view_inv_loc.inv_mast_uid
,p21_view_alternate_code alternate_code left outer join CommerceCenterImport.dbo.p21_view_alternate_code on p21_view_inv_mast.inv_mast_uid=p21_view_alternate_code.inv_mast_uid
WHERE p21_view_alternate_code.alternate_code is null AND p21_view_inv_loc >100004 and p21_view_inv_mast.delete_flag='N'

ORDER BY p21_view_inv_mast.item_id, p21_view_alternate_code.alternate_code
 
CommerceCenterImport.dbo.p21_view_inv_loc ON p21_view_inv_mast.inv_mast_uid=p21_view_inv_loc.inv_mast_uid
,p21_view_alternate_code alternate_code left outer join CommerceCenterImport.dbo.p21_view_alternate_code

is not just:

CommerceCenterImport.dbo.p21_view_inv_loc ON p21_view_inv_mast.inv_mast_uid=p21_view_inv_loc.inv_mast_uid left outer join CommerceCenterImport.dbo.p21_view_alternate_code

Thanks

VJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top