I have a situation to write this code in SQL to used in SSIS.if table1.username in (table2.username) (and table1.status <> not active then revoke table2.username permissions on server and update table.date column = today-1)if elseIf table1.status = active thencreate login for table1.user name in sql server and grant only one database role.Elseif table1.status = 512 and table1.username not in table2.usernamethen create login for table1.username and grant database role and alsoinsert table1.name in table 2Please give some ideas, how can I write the above logic in T-sql. Many Thanks in Advance
↧