RE: Vendor modifier - PSTL Error
Turned out to be an interesting project. Here is how resolved the problem.
1. Decrypt stored procedure smVendorChange1
jongurgul.com/.../sql-object-decryption
2. Beautify tsql output
www.freeformatter.com/sql-formatter.html
3. Find word "SERIES" smVendorChange1 stored procedure
(I am selecting only the section where the issue was identified)
select
'update ['+o.name+'] set CustomerVendor_ID =' + rtrim(@cEndVendor) + ' where SERIES = 4 and CustomerVendor_ID = ' + rtrim(@cStartVendor)
from
sysobjects o,
syscolumns c
where
o.id = c.id
and o.type = 'U'
and c.name = 'CustomerVendor_ID'
and o.name <> 'EDCVAT26'
5. Find Tables being updated by smVendorChange1
select *
from
sysobjects o,
syscolumns c
where
o.id = c.id
and o.type = 'U'
and c.name = 'CustomerVendor_ID'
and o.name <> 'EDCVAT26'
6. Find the table which does not have the field series
select o.name from sysobjects o, syscolumns c
Where o.id = c.id and o.type = 'U' and c.name = 'CustomerVendor_ID' and o.name <> 'EDCVAT26'
AND O.NAME NOT IN ( select TABLE_NAME from [INFORMATION_SCHEMA].[COLUMNS] where
table_name in ( select o.name from sysobjects o, syscolumns c where o.id = c.id and o.type = 'U' and c.name = 'CustomerVendor_ID' and o.name <> 'EDCVAT26' ) AND Column_name = 'SERIES' )
Returned VTX_TXAUDIT
7. Resolution - VTX_TXAUDIT had no record. For the purpose of getting the vendor id changed updated the field CustomerVendor_ID to CustomerVendor_ID1 so that PSTL vendor modifier does not check this table. Completed the modifier project and reverted back the field name.
Cheers!
Sanjay