Monday, March 19, 2012

Enterprise Manager problem with views

We have a user who is a db_owner on a database that he can't create a view using Enterprise Manager. When he tries to create a view it returns: "ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '240'." His NT Domain username is 240DBH.

We've tried it on my computer with him logging on and get the same result. He can create views just fine using query analyzer. Does anybody know what's wrong with doing this in Enterprise Manager? By the way, I can create views in the db using Enterprise Manager just fine.

Thanks for your help!Turn Profiler on and see what commands Enterprise is sending to the server to create this view. It may shed some light.|||Thanks for the suggestion! I hadn't used the profiler before. It is trying to execute the following:

CREATE VIEW 240dbh.VIEW1
AS
SELECT ID, [Start Date]
FROM T_DATA

Now, when I run this in query analyzer, I get the same error. It seems like that should work to me.:confused:|||Now I think I have it narrowed down. His username starts with numbers. If you can't have a username that starts with numbers, that is pretty lame.

Does anyone know if there is a better front-end than enterprise manager for creating tables/views/stored procedures?

Thanks!|||User names with numbers are not a problem. Does the user have ddladmin rights?

If you are using SS2K than use the Query Analyzer! Much better for users than the EM!|||I set up a user under sql server 7 with a username that has no numbers with the exact same permissions as that user who can't create a view.

That new user with no numbers can create views just fine.

So, the only difference between the two users is that one is a sql server logon and one uses NT domain authentication, and the fact that one has numbers in the username.

What I'm finding is that if enterprise manager would do something like:
CREATE VIEW [240dbh].VIEW1

instead of:
CREATE VIEW 240dbh.VIEW1

it would work.

No comments:

Post a Comment