I’ve got a SQL UDF that I need to define both WITH SCHEMABINDING and WITH EXECUTE AS OWNER on. I’ve tried a number of combinations including listing the WITH keyword twice, trying various methods of concatenation or operators, etc, and haven’t had a lot of luck.
Can anybody help me with how to define multiple WITH statements in a single UDF
CREATE FUNCTION [dbo].[Func_PullFolderIdsForUser](@companyId [int], @userId [int])
RETURNS @folders TABLE (
[FolderID] [int] NULL,
) WITH SCHEMABINDING
AS
BEGIN
Comma delimit them. e.g.