code_junkie

Are GUID collisions possible?

Nov 11th, 2011
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. declare @table table
  2. (
  3. column1 uniqueidentifier default (newid()),
  4. column2 int,
  5. column3 datetime default (getdate())
  6. )
  7.  
  8. declare @counter int
  9.  
  10. set @counter = 1
  11.  
  12. while @counter <= 10000
  13. begin
  14. insert into @table (column2) values (@counter)
  15. set @counter = @counter + 1
  16. end
  17.  
  18. select * from @table
  19.  
  20. select * from @table t1 join @table t2 on t1.column1 = t2.column1 and t1.column2 != t2.column2
Add Comment
Please, Sign In to add comment