May 8, 2013 at 3:05 pm
We have a VS 2012 .sqlproj database project. We would like to use a scalar valued user defined function to validate one of the table fields in the form of a check constraint.
Example:
ALTER TABLE [dbo].[MyTable] ADD CONSTRAINT [CK__MyTable__ColHID] CHECK (dbo.fnValidateHierarchy(ColHID) = 1);
What is the proper way to do this?
We keep experiencing the following error when adding this to the table definition script:
contains an unresolved reference to an object. Either the object does not exist or the reference is ambiguous because it could refer to any of the following objects: [dbo].[fnValidateHierarchy] or [dbo].[Mytable].[dbo]::[fnValidateHierarchy].c:\...\dbo\Tables\MyTable.sql
May 8, 2013 at 3:16 pm
Ignore this topic. There was a type-o which caused the issue.
Please delete post.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy