I have a database where the primary user logging into the database has no permissions to any of the tables directly. THe user needs to execute stored procedures which have been explicitly granted to it. This covers any straightforward CRUD operation that is needed. But now, I have a need to execute SQL Dynamically but I want to maintain the same level of security on my user. An example would be
UPDATE [Table] SET [Column 1] = @Column1
But in this situation [Column 1] and its value would be set at runtime.
THe only way I know to execute dynamic code in a stored procedure is to use sp_runsql, but creating a stored procedure that executes a dynamic query using sp_runsql fails for security reasons (and in general isnt very smart)
Can anyone think of a way to achieve this level of functionality and security?