On Thu, Aug 26, 2010 at 4:11 PM, Vincent Teachout <[email protected]> wrote:
> I'm fairly good with SQL, but I really don't know a lot about MSSQL.
>
> I have a new field: UID, char(10).  I'd like to fill it with a 10
> character incrementing "number"  i.e.,
> "0000000000"
> "0000000001"
> "0000000002"
> .... etc, up to the number of records currently in the file.

--Set up vars
declare @number int
declare @string varchar(10)
declare @size_of_fixed_string tinyint

set @size_of_fixed_string = 10
set @number = 40


print replicate( '0', @size_of_fixed_string )

pretty simple.


-- 
Stephen Russell

Sr. Production Systems Programmer
CIMSgts

901.246-0159 cell

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to