identity column

    Date: 08/26/05 (SQL Server)    Keywords: sql

    I'd like to create an column in one of my tables that contains unique five digit numbers to use as an identifier. I'm a bit of a SQL Server newbie, so forgive me if this is simple. I found the identity() property, which is works well enough to give me ascending numbers, but I want my numbers to always have five digits.

    So I'd want the first record to be 00001, the second to be 00002, the third to be 00003, etc. Right now, I'm getting the first record as 1, the second as 2, the third as 3, etc.

    Thoughts?

    Source: http://www.livejournal.com/community/sqlserver/32440.html

« Visual Studio.Net 2003 Query || Restore Database via Script? »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home