473,382 Members | 1,380 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Unique constraint Bug ????

Hi all

i have a problem with my sql dataadapter, i think.
i have this table below ( Script ) and this table has one particularity, it
has 2 unique constraints.

when i´m filling my datatable using my dataadapter, the datatable only have
one ???

is there any workarround for it, besides do it by code ???

thsk
JSB


CREATE TABLE [dbo].[xTable] (
[Test0] [char] (10) COLLATE Latin1_General_CI_AS NOT NULL ,
[Test1] [char] (10) COLLATE Latin1_General_CI_AS NULL ,
[Test2] [char] (10) COLLATE Latin1_General_CI_AS NULL ,
[Test3] [char] (10) COLLATE Latin1_General_CI_AS NULL ,
[Test4] [char] (10) COLLATE Latin1_General_CI_AS NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[xTable] ADD
CONSTRAINT [PK_xTable] PRIMARY KEY CLUSTERED
(
[Test0]
) ON [PRIMARY] ,
CONSTRAINT [IX_xTable] UNIQUE NONCLUSTERED
(
[Test0],
[Test1]
) ON [PRIMARY] ,
CONSTRAINT [IX_xTable_1] UNIQUE NONCLUSTERED
(
[Test2],
[Test3],
[Test4]
) ON [PRIMARY]
GO

Nov 17 '05 #1
1 1043
Please don't cross-post to non SQL related NG, post SQL questions to a SQL
related NG's like this portugese NG microsoft.public.pt.sql.

Willy.
"Joăo Santa Bárbara" <jo****@i24portugal.com> wrote in message
news:uK**************@tk2msftngp13.phx.gbl...
Hi all

i have a problem with my sql dataadapter, i think.
i have this table below ( Script ) and this table has one particularity,
it has 2 unique constraints.

when i´m filling my datatable using my dataadapter, the datatable only
have one ???

is there any workarround for it, besides do it by code ???

thsk
JSB


CREATE TABLE [dbo].[xTable] (
[Test0] [char] (10) COLLATE Latin1_General_CI_AS NOT NULL ,
[Test1] [char] (10) COLLATE Latin1_General_CI_AS NULL ,
[Test2] [char] (10) COLLATE Latin1_General_CI_AS NULL ,
[Test3] [char] (10) COLLATE Latin1_General_CI_AS NULL ,
[Test4] [char] (10) COLLATE Latin1_General_CI_AS NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[xTable] ADD
CONSTRAINT [PK_xTable] PRIMARY KEY CLUSTERED
(
[Test0]
) ON [PRIMARY] ,
CONSTRAINT [IX_xTable] UNIQUE NONCLUSTERED
(
[Test0],
[Test1]
) ON [PRIMARY] ,
CONSTRAINT [IX_xTable_1] UNIQUE NONCLUSTERED
(
[Test2],
[Test3],
[Test4]
) ON [PRIMARY]
GO

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: KULJEET | last post by:
foreign key also refer to unique constraint. (GREAT...) 1.then table that containt unique constraint act as master table????? 2.IS unique constraint will replace with primary key?? 3.Is unique...
26
by: Agoston Bejo | last post by:
I want to enforce such a constraint on a column that would ensure that the values be all unique, but this wouldn't apply to NULL values. (I.e. there may be more than one NULL value in the column.)...
5
by: Kamil | last post by:
Hello What should I use for better perfomance since unique constraint always use index ? Thanks Kamil
4
by: Dave | last post by:
Can you create a unique constraint on multiple columns, or does it have to be implemented as a unique index? If possible can someone please post some sample code? Thanks,
3
by: Prince Kumar | last post by:
Is there any way I can define an Unique constraint or unique index which allows more than one null values for the same column combination in DB2? ie, If my index is defined on (col3, col4) where...
10
by: BuddhaBuddy | last post by:
Platform is DB2/NT 7.2.9 The table was created like this: CREATE TABLE MYTEST ( MYTESTOID bigint not null primary key, FK_OTHEROID bigint not null references other, FK_ANOTHEROID bigint not...
5
by: aj | last post by:
DB2 WSE 8.1 FP5 Red Hat AS 2.1 What is the difference between adding a unique constraint like: ALTER TABLE <SCHEMA>.<TABLE> ADD CONSTRAINT CC1131378283225 UNIQUE ( <COL1>) ; and adding a...
7
by: Brian Keating | last post by:
Hi there, Is it possible to add a unique constraint on two columns in a table, so that the constraint is a composite of the two? i.e. these two columns together should be unique...? i.e....
10
by: Laurence | last post by:
Hi there, How to differentiate between unique constraint and unique index? These are very similar but I cannot differentiate them? Could someone give me a hand? Thanks in advance
2
by: rorajoey | last post by:
Violation of UNIQUE KEY constraint 'IX_surveyQuestions'. Cannot insert duplicate key in object 'dbo.surveyQuestions'. This might seem like a simple matter of trying to insert a row with ID=20 when...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.