I understand in SQL Server GUIDs are MOSTLY unique, and also that the likelihood of a collision is remote, yet at the same time someone must win the lottery so I feel like it makes some sense to prepare for the possibility.
Which is faster/better practice
Using a technique where I assign a new GUID directly by just inserting a row and checking for an error (@@ERROR <> 0) and repeating until I don't get an error [which I suppose in theory would only at worst be once...]
or using an approach like this
DECLARE @MyGUID uniqueidentifier
SELECT @MyGUID = NewID()
if exists(select * from tablename where UserID=@MyGUID)
and looping over that till I find one not in use.
I like the 2nd approach because I can then have the GUID for use later on in the Stored Procedure so I'm currently leaning towards that one.