- Where Developers Learn, Share, & Build Careers
that requires the first 4 four modules per file to be in the form of the name length, as 8 characters to . My question: Each line will be included in the fileNamerandomNUM for example: dba.GenerateRandomNumbersLetters (4) it will provide a random number, but recent random generated duplicate in a situation, I can not even how to avoid such scenarios do, please advise Repeat the value for a random number There is a danger, especially if you take only the first four digits of the random number. Instead, generate sequence numbers. To apply it, you can create a table with the structure Then every time you want to get a file name, the query against this table for the next serial number DDMM and balance using four characters function and scene trying to get random number of databases, so I'm using the database which I pasted below: < P> Function: create function [dbo] [GenerateRandomNumbersLetters] (@NumberOfCharacters TINYINT) PS VARCHAR (starting back as 32) (left (REPLACE ([NewID], '-', ''), @NumberOfCharacters) from dbo. Retrieve Krennuved); End: See
See [dbo] Create [RetrieveNewID] as selection [NewID] = NEWID ();
select SUBSTRING (Place (convert (varchar (10), getdate (), 3), '/', ' For example: 0907CCE7
file_date | Seek_Ax0907 | 1000 0907 | 1001
select max (seq_no ) With your +1 & LT; Table & gt;
Comments
Post a Comment