SQL Server : does NEWID() always gives a unique ID?

Both NEWID() and NEWSEQUENTIALID() give globally unique values of type uniqueidentifier. NEWID() involves random activity, thus the next value is unpredictable, and it’s slower to execute. NEWSEQUENTIALID() doesn’t involve random activity, thus the next generated value can be predicted (not easily!) and executes faster than NEWID(). So, if you’re not concerned about the next value … Read more

newid() inside sql server function

here’s a clever solution: create view getNewID as select newid() as new_id create function myfunction () returns uniqueidentifier as begin return (select new_id from getNewID) end that i can’t take credit for. i found it here: http://omnibuzz-sql.blogspot.com/2006/07/accessing-non-deterministic-functions.html -don

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)