Using two "With" statements in a stored procedure

  • When I try to include two With statements in my stored procedure, I get a syntax error:

    Alter Procedure [dbo].[RemoteLink]

    @LinkedServerName Varchar(50)

    With Encryption

    With Execute As 'RemoteLink'

    As


    If I use either one, no error.  How do you stack "With" statements?

  • There's just one WITH clause, and specify the options you want:

    WITH ENCRYPTION, EXECUTE AS 'RemoteLink'

    Cheers!

  • Jacob Wilkins - Tuesday, March 27, 2018 12:31 PM

    There's just one WITH clause, and specify the options you want:

    WITH ENCRYPTION, EXECUTE AS 'RemoteLink'

    Cheers!

    Thanks a million!

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

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