/* add user */
CREATE USER [fnMyFunctionName] FROM EXTERNAL PROVIDER;
/* or with slot:
CREATE USER [fnMyFunctionName/slots/staging] FROM EXTERNAL PROVIDER;
*/
/*allow to read data */
EXEC sp_addrolemember 'db_datareader', [fnMyFunctionName];
/*allow to write data */
EXEC sp_addrolemember 'db_datawriter', [fnMyFunctionName];
/* this is the pipeline user */
CREATE USER [(service connection name)] FROM EXTERNAL PROVIDER;
/*make it an owner so it can modify the db*/
EXEC sp_addrolemember 'db_owner', [nsweservice connection name];
Leave a Reply