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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:07:49+00:00 2026-06-11T17:07:49+00:00

I want to select two columns in my table and make them unique but

  • 0

I want to select two columns in my table and make them unique but I don’t know how to do it in SQL Azure database. As you can see in the image below, it doesn’t show any option to modify the table properties, so everything is done using sql queries:
enter image description here

Here is the generated script of the table:

USE [mydbase]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[clientaccess](
    [ID] [bigint] IDENTITY(1,1) NOT NULL,
    [ModuleName] [nvarchar](50) NOT NULL,
    [ClientAuthenticationId] [bigint] NOT NULL,
    [HasAccess] [bit] NOT NULL,
 CONSTRAINT [PK_clientaccess_ID] PRIMARY KEY CLUSTERED 
(
    [ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON)
)

GO

ALTER TABLE [dbo].[clientaccess]  WITH CHECK ADD  CONSTRAINT [CAI_caID] FOREIGN KEY([ClientAuthenticationId])
REFERENCES [dbo].[clientauthentication] ([ID])
GO

ALTER TABLE [dbo].[clientaccess] CHECK CONSTRAINT [CAI_caID]
GO  

This is the preview where I encountered the problem, it contains duplicate records:
enter image description here

Hope someone understand my explanation.

  • 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-11T17:07:50+00:00Added an answer on June 11, 2026 at 5:07 pm

    Sometimes GUIS have limitations (or not but you haven’t discovered yet how all functionalities work). You can always add a unique constraint with ALTER TABLE:

    ALTER TABLE [dbo].[clientaccess] 
      ADD CONSTRAINT Module_Client_UQ                --- choose a name
      UNIQUE (ModuleName, ClientAuthenticationId) ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to join two tables with several hundred columns, like this: select *
Put simply, I want to select all data in two columns from each of
I have two table emptable1(empid,status) emptable2(empid,week) i want to select all the empid whose
I want to join these two table but the join key of the second
I have SQL Server database for users, and now I want to make simple
I have a table in my database with two columns as int for example
I want a template to select from two types based on some condition. E.g.
I have two tables: colleges (id) and users_colleges (user_id, college_id) I want to select
I have two tables - forum_topics and topics_posts . I want to select rows
hi i am newbie to javascript.... i want to synchronize scrolling of two select

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.