
IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'publ_QuoteItems' AND COLUMN_NAME = 'IsCatList')
BEGIN
	ALTER TABLE [dbo].[publ_QuoteItems] DROP COLUMN [IsCatList]
END
GO

ALTER TABLE [dbo].[publ_QuoteItems] ADD [IsCatList] AS (CONVERT([bit], CASE WHEN [QuoteItems_QuoteItems_QuoteItemsSupplier]='CAT' THEN (1) ELSE (0) END))