I have a table of data with a primary key which generally takes the format of $$$$#####$$
, although there a couple of exceptions to this where there is no number. I want to extract the number part of the key and then use it so I can generate unique primary keys.
I therefore created a view which contained a column showing only the numeric value and ignored any items which could not convert to numbers.
When I wrote a query to select a specific item from the view I get
Conversion failed when converting the nvarchar value to data type int.
and it would appear that although I specifically ignored the exceptions in the view they are still being references some how.
Any help would greatly be appreciated.
Matt