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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:13:14+00:00 2026-06-08T13:13:14+00:00

I have supplier table with supplier id as the primary key. I have a

  • 0

I have supplier table with supplier id as the primary key. I have a supplier type column which can be airline (AL), hotel (HT), Tour (T).

For the supplier type airline (AL) I want the airline_type and airline_abbr columns to be composite unique as well as the airline_type and airline_iata_code to be composite unique.

I don’t want to set this as the primary key because primary key is already declared.

How to go about it? Any ideas or suggestions?

Thanks,

  • 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-08T13:13:16+00:00Added an answer on June 8, 2026 at 1:13 pm

    You can create unique filtered indices on your table:

    CREATE UNIQUE NONCLUSTERED INDEX IX_Airline_TypeAbbr
    ON dbo.Supplier (airline_type, airline_abbr)
    WHERE supplier_type = 'AL'
    
    CREATE UNIQUE NONCLUSTERED INDEX IX_Airline_TypeIataCode
    ON dbo.Supplier (airline_type, airline_iata_code)
    WHERE supplier_type = 'AL'
    

    You can read more about what filtered indexes are and how to use them in Pinal Dave’s excellent blog post on the topic

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

Sidebar

Related Questions

I have an SQLite table that uses an autogenerated id as primary key. I
In my database table I have the following fields: Table Supplier: id name vehicles
I have the following SQL statement which returns Not unique table/alias . I'm fairly
I have 3 table : hotel : id, hotel_name hotel_supplier:id, supplier_name hotel_price:id, hotel_id, supplier_id,
I have a couple of dynamically built query's with a composite primary key on
I have this: <table id=myTable style=width: 650px;> <thead> <tr style=font-weight: bold;> <td>Name</td> <td>Price</td> <td>Supplier</td>
I have this: alter table supplier add constraint supplier_unique unique (supplier_id) where supplier_id is
I have a table which holds partnumbers and prices of those partnumbers. This is
Given the following very simple table: Create Table tblUserLogins ( LoginNumber int PRIMARY KEY
I have a query as below to find duplicates in my table which contains

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.