Live Traffic Feed

Wednesday, October 10, 2018

How to use NEWID() in sql server function

Leave a Comment
Sql server function not allow to use NEWID() function.

Solution:
-> Create view in same database from following query:

CREATE VIEW [dbo].[GetNewID] AS SELECT NEWID() AS new_id

Now you can use SELECT new_id FROM [dbo].[GetNewID] instead of NEWID() in your query in sql server function.
If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment