cancel
Showing results for 
Search instead for 
Did you mean: 

CREATE USER Statement Fails If Username Starts With Number

jblanton
Discoverer
0 Kudos

When I run the CREATE USER statement in SQL Anywhere 12, it fails whenever the username starts with a number (giving a "Syntax error" error message). However, I can create a username that starts with a number just fine when using Sybase Central. Is there a work-around that allows me to create a user account that starts with a number using the CREATE USER statement?

Accepted Solutions (1)

Accepted Solutions (1)

chris_keating
Advisor
Advisor
0 Kudos

Sybase Central logs many of the statements that it executes via the View | Server Messages and Executed When that pane is opened, the Database tab will show the executed statements. You can also select the database object in SC and then do a copy and paste to see the syntax.

An user is an identifier and identifiers with leading digits must be quoted. Correct syntax examples include:

create user an_user identified by sql;
create user "1_an_user" identified by sql;
create user [2_an_user] identified by sql;
jblanton
Discoverer
0 Kudos

Thanks. Using the brackets around the user account name did the trick.

Answers (0)