Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Generating test data
Message
From
01/11/2006 15:35:23
 
 
To
01/11/2006 15:20:52
Evans Carl
System Answers Consulting, Inc
Big Lake, Minnesota, United States
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01166318
Message ID:
01166349
Views:
14
Hi Evans,

thanks for the idea. This brings up a couple more questions:

What if the value has to be a string of numeric characters? Is there a way to generate sequential numbers and convert them to characters?

How can I just return say 10 characters from the newid() function? Or would that then mean the values won't be unique?

>>Hi,
>>
>>I'm fairly new to SQL Server.
>>
>>I have a table with 300,000 odd records and for testing I am trying to use this data to increase the number of records 5 fold so I'll end up with approx 1.5 million records.
>>
>>So I can do this:
>>
>>INSERT INTO ()
>>SELECT
>>FROM
>>
>>My difficulty is that one of the fields is a varchar(50) field that stores a unique number from a form (something like an invoice number), so I need to generate a unique number for each record.
>>
>>Any suggestions how to do this?
>>
>>Thanks,
>You can use the NewId() function of SQL, this is create you a unique uniqueidentifier.
>
>select newId() as InvoiceNumber
>
>Evans Carl
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Reply
Map
View

Click here to load this message in the networking platform