Monday, February 20, 2012

My Query is not working.

I've gotten spoiled with all these query builders. Now in SQL server management studio express its gone. I don't understand whats wrong with their query...any help would be appreciated.

Confused

SELECT

[Products].myID, [ProductDetails].ShortName

FROM

[Products]

INNER

JOIN [ProductDetails]

ON

[Products].DetailID= [ProductDetails].myID

Parse comes back as
Command(s) completed successfully.

Execute comes back as
Msg 208, Level 16, State 1, Line 1
Invalid object name 'Products'.

Closed Enterprise manager and came back in and it magically started working again.|||Make sure you're in the correct database when you execute the querySmile In Management Studio, each query window represents a connection and can point to different databases (even differnet servers). Parse the command only means to check the syntax of your query without checking the referenced database objects. Imagine the difference between error when Parse and when execute is just like compile error VS runtime error (maybe not so exact, but should make sense)

No comments:

Post a Comment