Declare @ I smallint
Set @ I = 1
While (@ I <= 10000)
Begin
Insert into prvflat_stuinfo_part (stuid, identitycard, stuname, stucode, sex, region)
Values (newid (), '000000', 'ckj' + '@ I', @ I, '1', '20140901 ')
Set @ I = @ I + 1
End
Go
You can use the 32 guid in SQL Server to obtain the guid using newid.
Insert into [user] (ID, name, sex, password) values (newid (), 'xp ', '1', '123 ')
The ID data column must be of the 36-bit Char or uniqueidentifier type.
The following content comes from SQL Server online help
It can contain a reference to the guid data type, which is used to store globally unique identifiers. You can call the newid () function in the update query and insert Source Query to generate a new guid and store it in the database.
When creating a SELECT query, the only operation that can be performed on the guid type column is based on comparison of equal to (= and <>.
The following is another complicated method.
Declare @ I bigint
Declare @ Max bigint
Declare @ flatsign char (6)
Set @ I = 1
Set @ flatsign = '000000'
Set @ max = 50000
While (@ I <= @ max)
Begin
Insert into prvflat_stuinfo
(Stuid, schid, identitycard, stuname, unitivecode, sex, birthday, flatsign)
Values (newid (), newid (),
Convert (varchar (6), '000000') + convert (varchar (4), @ flatsign) + convert (varchar (8), replicate ('0 ', 8-len (rtrim (ltrim (@ I) + convert (varchar (8), @ I ),
'Chenkejun' + convert (char (9), @ I), convert (varchar (8 ),
Replicate ('0', 8-len (rtrim (ltrim (@ I) + convert (varchar (8), @ I ),
'M', '2017-08-08 ', @ flatsign)
Set @ I = @ I + 1
End