SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software
Development resources, articles, tutorials, code samples, tools and downloads for ASP.Net, SQL Server, Reporting Services, T-SQL, Windows, AWS, SAP HANA and ABAP


Check If SQL Server Database is TrustWorthy for CLR Creation

To create CLR objects like User-Defined Functions, Stored Procedure, Triggers on SQL Server database, enabling TrustWorthy property of the database is one option for passing security issues for SQL developers. This guides shows how SQL Server professionals can check whether the database is set as TrustWorthy or not.


Launch SQL Server Management Studio (SSMS).
Connect to target SQL Server instance.
On Object Explorer window, right click on the target SQL Server database and choose Properties context menu option.
On database Options page, in Miscellaneous group you will see an option "Trustworthy" either set to False (by default) or to True.

display and set SQL Server database option Trustworthy

On SQL Server, database administrators can alter Trustworthy property of a database executiong one of the following SQL commands after replacing your target database with sample database name shared here

-- To set database Trustworthy property as True
ALTER DATABASE [kodyaz.test] SET TRUSTWORTHY ON

-- To set Trustworthy option of a database to False
ALTER DATABASE [kodyaz.test] SET TRUSTWORTHY OFF
Code

Another way to check whether a database is set as TRUSTWORTHY or not is to query the sys.databases system view for is_trustworthy_on column value as follows.

select is_trustworthy_on from sys.databases where name = 'kodyaz.test'
Code


SQL Server

SQL Server 2019 Installation
download SQL Server 2019
download SQL Server 2017
download SQL Server 2016
download SQL Server 2014
download SQL Server 2012
MacOS ve SQL Server 2019


Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.