I am a NEWBIE at this as I am stepping up from A2k. In A2k the autonumber
used as the primary key allows formatting in which text can be used. Does M
S
SQL Server 2000 allow it as well? If so how does one go about it? Several
A2k databases are also being considered for upsizing and they have the text
in the autonumber thru the formatting.
Thanks to anyone responding.
*** JohnJohnE wrote:
> I am a NEWBIE at this as I am stepping up from A2k. In A2k the
> autonumber used as the primary key allows formatting in which text
> can be used. Does MS SQL Server 2000 allow it as well? If so how
> does one go about it? Several A2k databases are also being
> considered for upsizing and they have the text in the autonumber thru
> the formatting.
> Thanks to anyone responding.
> *** John
SQL Server does not deal with formatting. That is a client issue. Access
is a client and "server" in one. You should do the formatting in your
stored procedures, or preferably, on the client. For numbers in
particular, you could be dealing with different locales that require
different number formatting.
David Gugick
Imceda Software
www.imceda.com|||Nope, identity values are numeric values only. You might consider using a
calculated column for this:
create table test
(
testId int identity,
stringPartOfExposedKey char(10),
exposedKey as stringPartOfExposedKey + cast(testId as varchar(10)
)
or something like it.
----
Louis Davidson - drsql@.hotmail.com
SQL Server MVP
Compass Technology Management - www.compass.net
Pro SQL Server 2000 Database Design -
http://www.apress.com/book/bookDisplay.html?bID=266
Blog - http://spaces.msn.com/members/drsql/
Note: Please reply to the newsgroups only unless you are interested in
consulting services. All other replies may be ignored :)
"JohnE" <JohnE@.discussions.microsoft.com> wrote in message
news:8CE12EBA-C7D3-45B5-9CD6-9BFAB40D2E93@.microsoft.com...
>I am a NEWBIE at this as I am stepping up from A2k. In A2k the autonumber
> used as the primary key allows formatting in which text can be used. Does
> MS
> SQL Server 2000 allow it as well? If so how does one go about it?
> Several
> A2k databases are also being considered for upsizing and they have the
> text
> in the autonumber thru the formatting.
> Thanks to anyone responding.
> *** John
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment