Post by Mark A. ParsonsI'm gonna assume you issued this command via some GUI ... because when I
====================
2> go
---------------------------------------------------------------------------------------------------------------------------
Adaptive Server Enterprise/15.0.2/EBF 15963 ESD#6/P/NT (IX86)/Windows
2000/ase1502/2537/32-bit/OPT/Wed Oct 01 21:41:43 2008
1> sp_addlogin heinz, password, null, null, "these are more than 30 characters I think"
2> go
'these are more than 30 characters I think' is not a valid name.
(return status = 1)
===================
If you're not getting an error via isql ... what's your ASE version?
------------------------------------------
- sp_addlogin determines that the max length for the syslogins.fullname column is 30
- sp_addlogin makes a call to an undocumented version of valid_name()
which in this case causes the generation of the 'Msg 17240' (ie, the input
string is > 30 characters in length)
- syslogins.fullname is still defined as varchar(30) (at least in my ASE version)
improperly declared as varchar(255). Did you find documentation somewhere
obviously (?) there's a bug in the documentation, eh
Post by Heinz MüllerHi,
I figured out a different behaviour if I create a login with more than 30
sp_addlogin heinz, password, null, null, "these are more than 30 characters I think"
In ASE 12.5 the account is created but the fullname column cropped after 30 characters.
In ASE 15.0.2 the account isn't created at all.
Anyone know if this a feature of 15.0.2? Any parameters I can set to get
the 12.5.x behaviour?
THX!
Heinz
Hmmmmm, per the 15.0 documentation master.dbo.syslogins.fullname is varchar
(30) so it looks like you can't put 255 Ibs. in a 30 Ib. bag. It looks like
the argument definition is incorrect. Also:
valid_name
Description Returns 0 if the specified string is not a valid identifier or a
number other than
0 if the string is a valid identifier, and can be up to 255 bytes in length.
Syntax valid_name(character_expression [, maximum_length])
Parameters character_expression
is a character-type column name, variable, or constant expression of char,
varchar, nchar or nvarchar type. Constant expressions must be enclosed in
quotation marks.
maximum_length
is an integer larger than 0 and less than or equal to 255. The default value
is
30. If the identifier length is larger than the second argument, valid_name
returns 0, and returns a value greater than zero if the identifier length is
invalid.
Examples Creates a procedure to verify that identifiers are valid:
create procedure chkname
@name varchar(30)
as
if valid_name(@name) = 0
print "name not valid"
Usage . valid_name, a system function, returns 0 if the character_
expression is not
a valid identifier (illegal characters, more than 30 bytes long, or a
reserved
word), or a number other than 0 if it is a valid identifier.
. Adaptive Server identifiers can be a maximum of 16384 bytes in length,
whether single-byte or multibyte characters are used. The first character of
an identifier must be either an alphabetic character, as defined in the
current character set, or the underscore (_) character. Temporary table
names, which begin with the pound sign (#), and local variable names,
which begin with the at sign (@), are exceptions to this rule. valid_name
returns 0 for identifiers that begin with the pound sign (#) and the at sign
(@).
. For general information about system functions, see "System functions"
on page 68.
Standards ANSI SQL - Compliance level: Transact-SQL extension.
Permissions Any user can execute valid_name.
See also System procedure sp_checkreswords