Shweta
Well-known Member
- Joined
- Jun 5, 2011
- Messages
- 514
Hi All,
I have create a table using the below syntax:
I have not defined any column as Primary key.
Below are the values I am inserting in the above table.
Highlighted two rows have duplicate entries for both the columns. While executing it, it inserts only 9 rows in the table instead of 10 and ignoring the one complete row from the highlighted ones.
Second issue is, it is storing the data in a sorted manner by ProductId. However, I don't want that. There is no cluster index then why it is doing so. Please suggest.
Thanks in advance!!
Regards,
Shweta Jain
I have create a table using the below syntax:
Code:
create table tblProductSales (ProductID int, QuantitySold numeric)
I have not defined any column as Primary key.
Below are the values I am inserting in the above table.
Code:
insert into tblProductSales
select '1','10' union
select '3','23' union
select '4','21' union
[COLOR=#ff0000]select '2','12' union[/COLOR]
select '1','13' union
select '3','12' union
select '4','13' union
select '1','11' union
[COLOR=#ff0000]select '2','12' union[/COLOR]
select '1','14'
Highlighted two rows have duplicate entries for both the columns. While executing it, it inserts only 9 rows in the table instead of 10 and ignoring the one complete row from the highlighted ones.
Second issue is, it is storing the data in a sorted manner by ProductId. However, I don't want that. There is no cluster index then why it is doing so. Please suggest.
Thanks in advance!!
Regards,
Shweta Jain
Last edited: