Melody
Melody

Reputation: 1203

How to insert data using stored procedure after encrypted column using Always Encrypt option?

I am using sql server 2016 and i have encrypted the column using always encryption option. I have connected sql with entity frameworking in ASP.NET MVC application. The dats are inserting properly using insert option. But i cant able to insert using stored procedure via mvc application. I am getting the following error I have followed the below article. https://www.codeproject.com/Articles/1110564/WebControls/

How can we refresh the stored procedure to apply encryption?

Error: "The parameter \"@name\" does not have the same encryption information as the one it was created with. Use sp_refresh_parameter_encryption to refresh the parameter encryption information for the module."

Upvotes: 5

Views: 1859

Answers (1)

uygar.raf
uygar.raf

Reputation: 210

The error message pretty self-explanatory in this case. Since the encryption metadata has changed since the proc was created, you need to update it via running the sys.sp_refresh_parameter_encryption proc:

exec sys.sp_refresh_parameter_encryption 'SchemaName.ProcedureName'

Upvotes: 2

Related Questions