Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Generating test data
Message
From
01/11/2006 15:20:52
Evans Carl
System Answers Consulting, Inc
Big Lake, Minnesota, United States
 
 
To
01/11/2006 14:59:46
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01166318
Message ID:
01166329
Views:
14
>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
¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°¤º°`°º¤ø¤º°¤º°
Carl Evans
CEO & President
System Answers Consulting, Inc.
MCSD .NET, ASP.NET, C#.NET, VB.NET,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform