Search

varchar(max) in FK constraint? CREATE TABLE topic on BOL by Martin Smith

Active

1
0
Sign in
to vote
Type: Bug
ID: 775598
Opened: 1/2/2013 8:30:34 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
From http://msdn.microsoft.com/en-us/library/ms174979.aspx

"A column of type varchar(max) can participate in a FOREIGN KEY constraint only if the primary key it references is also defined as type varchar(max)."

Well I suppose technically it is correct but AFAIK it is not possible to create a PK with such a column so this can never arise.

I presume that this is intended to make the point that the length of varchar columns must be the same on both sides of the relationship.
Details (expand)

Product Language

English

Version

SQL Server 2012 - Standard Edition

Category

Documentation

Operating System

Not Applicable

Operating System Language

Not Applicable

Steps to Reproduce

N/A

Actual Results

N/A

Expected Results

N/A

Platform

 

Virtualization

 
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 1/2/2013 at 5:33 PM
Thanks for reporting this issue Martin. We will review and update the topic accordinglhy.

Kind regards,
Gail Erickson
SQL Server Documentation team
Sign in to post a workaround.