Showing posts with label unique. Show all posts
Showing posts with label unique. Show all posts

Monday, March 26, 2012

Parenthesis in field value

Hello all

I have a table called PRODUCT and the unique field in the table is called PARTNUMBER like so:

PARTNUMBER DESCRIPTION
12345(6) Widget 1
12347(5) Widget 2

my select SQL looks like this
SELECT * FROM PRODUCT WHERE PARTNUMBER = '12345(6)'

That statement fails. what can I do to get around this error?

Regards
The CaptainThe only obvious thing I can think of is that you should use the double quotes and not the single quotes.

This works in SQL View in Access:

SELECT PRODUCT.*, PRODUCT.PARTNUMBER
FROM PRODUCT
WHERE (((PRODUCT.PARTNUMBER)="12345(6)"));|||How does the statement fail? Does it produce an error message?

-PatP

Friday, March 23, 2012

Partitioning Question

Hi All,

When we are partitioning a table in SQL Server 2005 , we get the following error.

Any help appreciated

Partition columns for a unique index must be a subset of the index key.

Thanks

Manish

Got the answer. We have to have the partitioning key also as a part of the primary key for the table, if it is not already the primary key