Solved

data integration - generating unique id numbers

Posted on 2013-05-20
1
263 Views
Last Modified: 2013-05-20
select replace(NEWID(),'-','')
I am using the below script to generate new id numbers ie
3E06BE1EA11C474D8B5B04EB10E4836E

how do you generate like a 100 or so all at once?
Regards
0
Comment
Question by:Amanda Walshaw
1 Comment
 
LVL 12

Accepted Solution

by:
jmcmunn earned 500 total points
ID: 39183212
DECLARE @i int = 0
WHILE @i < 100 BEGIN
    SET @i = @i + 1
    select replace(NEWID(),'-','')
END

(sorry, edited to 100 as the bound per the question)
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question