Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

NEWID() Expand / Collapse
Author
Message
Posted Tuesday, August 27, 2013 2:54 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, October 16, 2014 5:30 AM
Points: 12, Visits: 97
Hi All,
I have to know which algorithm is used in NEWID() function or to know how it works internally?



Regards,
Ningaraju N E
Post #1488626
Posted Tuesday, August 27, 2013 2:59 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:25 AM
Points: 13,238, Visits: 11,010
http://en.wikipedia.org/wiki/Globally_unique_identifier



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1488632
Posted Tuesday, August 27, 2013 5:53 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, October 16, 2014 5:30 AM
Points: 12, Visits: 97
Hi Keon,

I Gone through the site,but i failed to get exactly which algorithm used?
Post #1488695
Posted Tuesday, August 27, 2013 5:58 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:25 AM
Points: 13,238, Visits: 11,010
Why is it so important to know the exact algorithm?



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1488697
Posted Tuesday, August 27, 2013 6:05 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, October 16, 2014 5:30 AM
Points: 12, Visits: 97
Actually we have used newid() in order by clause to do shuffling.But My Manager is asking me to get the algorithm used for that clause and need to compare with linear programming algorithm
Post #1488699
Posted Tuesday, August 27, 2013 7:51 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Friday, October 17, 2014 2:15 PM
Points: 13,077, Visits: 12,523
ningaraju.ne 46825 (8/27/2013)
Actually we have used newid() in order by clause to do shuffling.But My Manager is asking me to get the algorithm used for that clause and need to compare with linear programming algorithm


Well unless your boss has some connections at Microsoft you aren't going to get the logic. This code is compiled into the engine and you don't have the opportunity to view the source code. Does this same manager routinely ask the .NET team to "retrieve" the logic used in the .NET framework for generating a guid?


_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1488780
Posted Tuesday, August 27, 2013 7:55 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: 2 days ago @ 3:49 PM
Points: 31,161, Visits: 15,607
Sean Lange (8/27/2013)
ningaraju.ne 46825 (8/27/2013)
Actually we have used newid() in order by clause to do shuffling.But My Manager is asking me to get the algorithm used for that clause and need to compare with linear programming algorithm


Well unless your boss has some connections at Microsoft you aren't going to get the logic. This code is compiled into the engine and you don't have the opportunity to view the source code. Does this same manager routinely ask the .NET team to "retrieve" the logic used in the .NET framework for generating a guid?


+1. I haven't seen any internal algorithms documented well and I doubt you'll see this one.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1488782
Posted Tuesday, August 27, 2013 10:05 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 8:45 PM
Points: 35,342, Visits: 31,875
I don't have the link for it anymore but I found an MS White Paper on the subject. I believe I found it using "TYPE 4 GUID" as the search and then going through a whole lot of entries.

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1488849
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse