Topic: Lost WACA-Sch5_sect9.1
I think I'm doing something wrong but can't see what. This code creates all preferred taxa;
Drop table TX_All_Preferred
SELECT NBNData.dbo.TAXON_LIST.ITEM_NAME AS CheckList, NBNData.dbo.TAXON.ITEM_NAME,
CAST(NBNData.dbo.ufn_GetDesignations(NBNData.dbo.TAXON_LIST_ITEM.TAXON_LIST_ITEM_KEY, 1, 'SR00036300000001', NULL) AS nVarchar(254))
AS All_Designated, NBNData.dbo.TAXON_LIST.PREFERRED
INTO TX_All_Preferred
FROM NBNData.dbo.TAXON_LIST INNER JOIN
NBNData.dbo.TAXON_LIST_VERSION ON NBNData.dbo.TAXON_LIST.TAXON_LIST_KEY = NBNData.dbo.TAXON_LIST_VERSION.TAXON_LIST_KEY INNER JOIN
NBNData.dbo.TAXON_LIST_ITEM ON
NBNData.dbo.TAXON_LIST_VERSION.TAXON_LIST_VERSION_KEY = NBNData.dbo.TAXON_LIST_ITEM.TAXON_LIST_VERSION_KEY INNER JOIN
NBNData.dbo.TAXON_VERSION ON NBNData.dbo.TAXON_LIST_ITEM.TAXON_VERSION_KEY = NBNData.dbo.TAXON_VERSION.TAXON_VERSION_KEY INNER JOIN
NBNData.dbo.TAXON ON NBNData.dbo.TAXON_VERSION.TAXON_KEY = NBNData.dbo.TAXON.TAXON_KEY
WHERE (NBNData.dbo.TAXON_LIST.PREFERRED = 1)
It uses a taxon designation set ['SR00036300000001'] I created which has the correct designations in it;
Title Taxon_Designation_Set_Key Taxon_Designation_Type_Key SHORT_NAME
SERC Data Supply SR00036300000001 NBNSYS0000000009 WACA-Sch5_sect9.1(kill/injuring)
SERC Data Supply SR00036300000001 NBNSYS0000000010 WACA-Sch5_sect9.1(taking)
When I use;
SELECT
FROM [NBNExtension].[dbo].[TX_All_Preferred]
WHERE CHARINDEX('9.1',All_Designated,1)>0
I get nothing returned. Obviously I tried "WACA-Sch5_sect9.1(kill/injuring)" and "WACA-Sch5_sect9.1" first, but it returned no values. I'm performing the same exercise on 15-20 designations and they are all returning results but no WACA-Sch5_sect9.1(kill/injuring) or WACA-Sch5_sect9.1(taking).
I understand that WACA-Sch5_sect9.1(kill/injuring) is now WACA-Sch5_sect9.1a and WACA-Sch5_sect9.1(taking) is now WACA-Sch5_sect9.1b but this does not seem to have been changed in Recorder. Though I noticed that "England_NERC_S41" changed from "England NERC S41" in the last updates I did and this had consequences since I refer to these names explicitly in All_Designations.
So if any of you can spot my error I would much appreciate it.
Somerset Environmental Records Centre