question

leethemuse avatar image
leethemuse asked

SELECT...GROUP BY works to execute a view but not otherwise

Hi

I am trying to execute a SELECT Query in MSSQL Server 2008. This is our primary Database engine which runs on Windows Server 2003.

SELECT...GROUP BY Query:

SELECT Area FROM dbo.[Spool Numbers]

WHERE(JobNbr LIKE '17-0020%')

GROUP BY Area;

The error I am receiving follows:

Msg 208, Level 16, State 1, Line 1 Invalid object name 'dbo.Spool Numbers'.

I left out the 'dbo' at a point in time and got the same error (Excluding the dbo.). I don't understand the error because it worked fine when I tried a 'View'.

I got the results I needed.

I am fairly new to working on real databases. I've only came across errors at school.

How can I resolve this? Also if you can guide me to training, that will be great! The more I learn the better.

sql-server-2008-r2error-messagemssql
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

WRBI avatar image WRBI commented ·

Is dbo.[Spool Numbers] a view or a table then? Please post your DDL for it.

I would also advise trying to stick away from having spaces in table names. Go with

SpoolNumbers or spoolNumbers

0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.