Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3848324
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T16:41:06+00:00 2026-05-19T16:41:06+00:00

I have a table that has id column of type uniqueidentifier. This column is

  • 0

I have a table that has id column of type uniqueidentifier. This column is PK too. This column has a default value of NewSequentialID() however most of the time its been populated through NewID() function. This table has another datetime type column too. I need to order results from this table by datetime column but if value of datetime is same that I need to get the data in same order as it was inserted in this table ( meaning the row that got inserted first should display first). If I order my result by datetime first and then by Id column, will it give me what I need?

I know there could be better approaches ( like having some int type column with identity or something rather then relying on uniqueidentifier) but this thing is already in production and i need this sorting just for some repors.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T16:41:06+00:00Added an answer on May 19, 2026 at 4:41 pm

    No, it’s not reliable. From the documentation:

    Creates a GUID that is greater than any GUID previously generated by this function on a specified computer since Windows was started. After restarting Windows, the GUID can start again from a lower range, but is still globally unique.

    It will probably work most of the time, but if your server has ever been restarted (and presumably it has if you are applying security updates) then you may run into problems. On the other hand, it’s unlikely that there will be two rows inserted at the same time that the server was restarted so you may get away with it… but I’d strongly recommend changing your data model.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database table that has a non null column of type uniqueidentifier
i have a table that has following column Type -------- type 1 type 2
I have a column in mysql table that has the the data type INT(11).
I have a column in my table that has values of type FLOAT. How
I have a table that has a column with SQL_Variant type and some other
I have a table that has a column with type of dateTime(I'm using SQL
I have table that has a column of type DateTime, I would like to
I have created a table that has a strongly type XML column in SQL2008
I have a table in which one column (type ntext) has data that includes
I have a table that has a column that has the cost of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.