Friday, March 23, 2012

Executing a practice script

Im trying to execute four practice scripts for a SQL fundamentals class
setup. The first three scripts run fine. The last script gives me the
following errors:
Server: Msg 3701, Level 11, State 5, Line 1
Cannot drop the table 'Orders', because it does not exist in the system
catalog.
Server: Msg 3701, Level 11, State 5, Line 2
Cannot drop the table 'Product', because it does not exist in the system
catalog.
Server: Msg 3701, Level 11, State 5, Line 2
Cannot drop the table 'Customer', because it does not exist in the system
catalog.
Server: Msg 128, Level 15, State 1, Line 8
The name 'C001' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 9
The name 'C002' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 10
The name 'C003' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 11
The name 'C004' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 12
The name 'C005' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 13
The name 'C006' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 14
The name 'C007' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 15
The name 'C008' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 3
The name 'P010' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 4
The name 'P009' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 5
The name 'P008' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 6
The name 'P007' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 7
The name 'P006' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 8
The name 'P005' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 9
The name 'P004' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 10
The name 'P003' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 11
The name 'P002' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 12
The name 'P001' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 3
The name 'O001' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 4
The name 'O002' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 5
The name 'O003' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 6
The name 'O004' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 7
The name 'O005' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 8
The name 'O006' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 9
The name 'O007' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 10
The name 'O008' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 11
The name 'O009' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
Server: Msg 128, Level 15, State 1, Line 12
The name 'O010' is not permitted in this context. Only constants,
expressions, or variables allowed here. Column names are not permitted.
When I connect from the client, I can connect to the database but no
information is available in my select statement.
www.aspfaq.com/5006
Based on the info you posted, it's doubtful anyone could tell you any more
than the error messages you already received...
"Buffalotech" <Buffalotech@.discussions.microsoft.com> wrote in message
news:354B7594-309E-4E1D-8C88-48288225D0DA@.microsoft.com...
> Im trying to execute four practice scripts for a SQL fundamentals class
> setup. The first three scripts run fine. The last script gives me the
> following errors:
> Server: Msg 3701, Level 11, State 5, Line 1
> Cannot drop the table 'Orders', because it does not exist in the system
> catalog.
> Server: Msg 3701, Level 11, State 5, Line 2
> Cannot drop the table 'Product', because it does not exist in the system
> catalog.
> Server: Msg 3701, Level 11, State 5, Line 2
> Cannot drop the table 'Customer', because it does not exist in the system
> catalog.
> Server: Msg 128, Level 15, State 1, Line 8
> The name 'C001' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 9
> The name 'C002' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 10
> The name 'C003' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 11
> The name 'C004' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 12
> The name 'C005' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 13
> The name 'C006' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 14
> The name 'C007' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 15
> The name 'C008' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 3
> The name 'P010' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 4
> The name 'P009' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 5
> The name 'P008' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 6
> The name 'P007' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 7
> The name 'P006' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 8
> The name 'P005' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 9
> The name 'P004' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 10
> The name 'P003' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 11
> The name 'P002' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 12
> The name 'P001' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 3
> The name 'O001' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 4
> The name 'O002' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 5
> The name 'O003' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 6
> The name 'O004' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 7
> The name 'O005' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 8
> The name 'O006' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 9
> The name 'O007' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 10
> The name 'O008' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 11
> The name 'O009' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 12
> The name 'O010' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> When I connect from the client, I can connect to the database but no
> information is available in my select statement.
|||Hi
At a guess there are a several possible reasons for this!
1. The script is wrong in that assumes the objects exist before trying to
drop them. This may imply that you have either not executed all the scripts,
or have not run them in the correct order.
2. You are running the script against the wrong database.
3. A combination of the above as the script uses the USE command to set the
database, but you have created a different database to the one documented as
there was already one that existed with the given name!
John
"Buffalotech" <Buffalotech@.discussions.microsoft.com> wrote in message
news:354B7594-309E-4E1D-8C88-48288225D0DA@.microsoft.com...
> Im trying to execute four practice scripts for a SQL fundamentals class
> setup. The first three scripts run fine. The last script gives me the
> following errors:
> Server: Msg 3701, Level 11, State 5, Line 1
> Cannot drop the table 'Orders', because it does not exist in the system
> catalog.
> Server: Msg 3701, Level 11, State 5, Line 2
> Cannot drop the table 'Product', because it does not exist in the system
> catalog.
> Server: Msg 3701, Level 11, State 5, Line 2
> Cannot drop the table 'Customer', because it does not exist in the system
> catalog.
> Server: Msg 128, Level 15, State 1, Line 8
> The name 'C001' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 9
> The name 'C002' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 10
> The name 'C003' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 11
> The name 'C004' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 12
> The name 'C005' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 13
> The name 'C006' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 14
> The name 'C007' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 15
> The name 'C008' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 3
> The name 'P010' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 4
> The name 'P009' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 5
> The name 'P008' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 6
> The name 'P007' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 7
> The name 'P006' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 8
> The name 'P005' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 9
> The name 'P004' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 10
> The name 'P003' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 11
> The name 'P002' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 12
> The name 'P001' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 3
> The name 'O001' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 4
> The name 'O002' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 5
> The name 'O003' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 6
> The name 'O004' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 7
> The name 'O005' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 8
> The name 'O006' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 9
> The name 'O007' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 10
> The name 'O008' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 11
> The name 'O009' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> Server: Msg 128, Level 15, State 1, Line 12
> The name 'O010' is not permitted in this context. Only constants,
> expressions, or variables allowed here. Column names are not permitted.
> When I connect from the client, I can connect to the database but no
> information is available in my select statement.
|||On Sun, 27 Mar 2005 18:55:02 -0800, Buffalotech wrote:
(snip)
>Server: Msg 128, Level 15, State 1, Line 8
>The name 'C001' is not permitted in this context. Only constants,
>expressions, or variables allowed here. Column names are not permitted.
(snip)
Another wild guess: this error is often caused because string constants
are enclosed in "double quotes" instead of 'single quotes'.
The good way to solve this is to open the script and replace all quotes.
The quikc and ugly kludge is to force non-standard interpretation of
quotes. Look up SET QUOTED_IDENTIFIER in BOL.
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)

No comments:

Post a Comment