How Combine two separate IF statements into One IF

  • IF EXISTS (SELECT 1 from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'r' and COLUMN_NAME = y )

    IF charindex('k',@hdr_where)=0

    INTO

    IF EXISTS ((SELECT 1 from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'r' and COLUMN_NAME = y ) and charindex('k',@hdr_where)=0)

  • Nearly there:

    IF (EXISTS (SELECT 1 from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'r' and COLUMN_NAME = y ) and

    (select charindex('k',@hdr_where))=0)

  • thanks for the reply !!!

  • No problem!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply