Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Property TextHeader is not available for View

I am trying to download a View from remote DB using Microsoft SQL Server 2016 Management Studio on Windows. I have an access to this DB, because I can preview the tables and views by running Select Top 200 rows. However, I want to download the whole view to my local disk. When I right-click on a view, and then select "Script View as" -> "Select To" -> "New Query Editor Window", select "Results to File" and click on "Execute", then I get an error:

Property TextHeader is not available for View... The property may not exist for this object or may not be retrievable due to insufficient access rights. the text is encrypted (Microsoft.SqlServer.Smo)

Can I resolve this issue by changing some settings or should I contact the database admin because it's the issue of access rights?

like image 492
TTT123 Avatar asked Feb 09 '17 18:02

TTT123


People also ask

How do I decrypt a stored procedure in SQL Server?

To do this, go to the Action menu and select 'Decryption Wizard…'. Once the wizard has opened, you can select all the objects you want to decrypt at once and what to do with the output of the wizard. You can have the T-SQL output go into a single file, create one file per object, or decrypt all the objects in place.

How can I see the encrypted stored procedure in SQL Server?

Drill-down until you reach the target database object in the Object Explorer windows as in below screenshot from the SQL Decryptor tool. Then right click on the stored procedure and choose Show DDL script menu option from the context menu. Or simply double-click on the encrypted stored procedure. That is it!

How do I encrypt a stored procedure in SQL Server?

To encrypt it, you add the WITH ENCRYPTION argument. You can also use the same argument to encrypt an existing procedure when using ALTER PROCEDURE . When you encrypt a stored procedure in this way, the procedure's text is converted to an obfuscated format. Its definition is not directly visible in any catalog views.


1 Answers

You are most likely connecting with an account that does not have VIEW DEFINITION permission on that database object.

If you are not sa, you need to contact the DB admin.

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/ee82df77-50da-4a95-a3ba-43aa6257f1d2/property-textheader-is-not-available-for-storedprocedure?forum=sqlsecurity

like image 135
manderson Avatar answered Oct 24 '22 14:10

manderson