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 8014291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:53:19+00:00 2026-06-04T19:53:19+00:00

In an SQL Server database, I created a Unique Constraint to ensure that one

  • 0

In an SQL Server database, I created a Unique Constraint to ensure that one of it’s tables contains only unique pairs of values.

The problem now is that the order of records I get is different. The records are sorted, but I want them to come in original order, just as they exist in the table, without any sorting.

I’ve checked everywhere, but couldn’t find a way to create a unique constraint without sort order. Is this supported at all?

  • 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-06-04T19:53:20+00:00Added an answer on June 4, 2026 at 7:53 pm

    The records are sorted, but I want them to come in original order, just as they exist in the table, without any
    sorting.

    Ah, the old sort issue – SQL for beginners.

    TABLES have a sort order that is the order of the clustered index. Missing that the odder is undefined.

    RESULTS have NO ORDER UNLESS DEFINED. SQL can change the order if it thinks it can process a query better. This is FUNDAMENTAL – you deal with data sets, and data sets per se are not ordered.

    So, if you want an order, ASK FOR IT.

    but couldn’t find a way to create a unique constraint without sort order.

    Why would you need an order for a unique constraint? A unique index should suffice, or? I would NOT make uniqueness a constraint but put – standard – a unique index on the fields. Especially as the index is good for – validating that they are unique and thus needed anyway.

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

Sidebar

Related Questions

iv created a database with some tables and populated them using SQL server 2008,
I have a database that I have created using SQL Server Developer 2008. I
I have created one user named tuser with create database rights in SQL server
I have a SQL Server 2005 database with several tables. One of the tables
I have a SQL Server Database with several tables. One of them has ID
I have a database created in SQL Server 2008 on my machine. It contains
I have a database created on SQL Server 2008 R2 hosted on Server A.
I am pretty new to C# and SQL Server database. I have created a
I have created a database in SQL Server 2008 Express Edition. Can I write
I have created a database with SQL Server Management Studio, I would like to

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.