August 2020

How to work with xml type using Query

OPENXML, a Transact-SQL keyword, provides a rowset over in-memory XML documents that is similar to a table or a view. sp_xml_preparedocument. This parses the XML document and returns a handle to the parsed document that is ready for consumption.  Example: Using nodes() Example: Using OpenXml() on the xml Data Type Using Cross Apply References: https://docs.microsoft.com/en-us/sql/relational-databases/xml/openxml-sql-server?view=sql-server-ver15

Availability group fail-over

Forced manual fail-over with data loss (2 step) To force failover with data loss, connect to the SQL Server instance that hosts the target secondary replica and then run the following command: When the previous primary replica recovers, it will also assume the primary role. To ensure that the previous primary replica transitions into a …

Availability group fail-over Read More »

How to find SQL server Object dependency

Using TSQL we can find all dependent objects from all databases including remote server linked objects (sql_expression_dependencies is ) Contains one row for each by-name dependency on a user-defined entity in the current database. This includes dependencies between natively compiled, scalar user-defined functions, and other SQL Server modules. https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-sql-expression-dependencies-transact-sql?view=sql-server-ver15