IF NOT EXISTS (
  SELECT PK_CardTemplate 
  FROM CardTemplate 
  WHERE RegularExpression = '<<template>>^%TPLC\&<<HotelName>>(.*)\&([0-9]+)\s\?\;\?\?\?\?\?\?\?\?\?\?\?\?\?\?([0-9]+)\?'
)
BEGIN
  DECLARE @PK_CardTemplate int
  
  INSERT INTO CardTemplate (
    RegularExpression,
    Note 
  ) VALUES (
    '<<template>>^%TPLC\&<<HotelName>>(.*)\&([0-9]+)\s\?\;\?\?\?\?\?\?\?\?\?\?\?\?\?\?([0-9]+)\?',
    'Picasso LoginCard SE'
  )
  
  SELECT @PK_CardTemplate = PK_CardTemplate 
  FROM CardTemplate 
  WHERE RegularExpression = '<<template>>^%TPLC\&<<HotelName>>(.*)\&([0-9]+)\s\?\;\?\?\?\?\?\?\?\?\?\?\?\?\?\?([0-9]+)\?' 
  
  INSERT INTO CardTypeTemplateXTab (
    FK_CardType,
    FK_CardTemplate,
    HotelCustomerNumber
  ) VALUES (
    4,
    @PK_CardTemplate,
    -1
  )  
END
