Skip to content

Tag Archives: sql server

Detecting SQL NULL in XQuery

When using XQuery inside SQL Server the value of SQL variables and columns can be referenced using the sql:column and sql:variable functions respectively. When a SQL value is NULL you may want to mark the XML element as xsi:nil, like the following.

<event_data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />

The semantic equivalent of SQL NULL in XQuery is an empty [...]

Hands off SA, sort of

It’s possible to Deny Connect permission to an Endpoint in SQL Server 2005. So I wondered if this would be a way disable the ’sa’ server account.

The sa account is disabled if the server only supports Windows security accounts, but is enabled if Mixed accounts are supported. Of course the recommendations are to use [...]

How does a SQL 2005 DB Mirror Ping?

A SQL Server 2005 High Safety DB Mirroring session synchronously transfers transactions from the primary DB to the mirroring DB and then with the help of a witness server supports automatic fail over from the primary to the mirror is the primary becomes unavailable. All the primary, mirror and witness nodes all keep an eye [...]

More Snapshot dmv’s

Following on from yesterdays post on sys.dm_tran_active_snapshot_database_transactions here is a look at four more dynamic management views that contain information about snapshot transactions.

sys.dm_tran_current_snapshot displays the transaction sequence number (XSN) for each transaction that was active when the current snapshot transaction started. sys.dm_tran_transactions_snapshot displays the all of the transactions with a XSN that were active when [...]

sys.dm_tran_active_snapshot_database_transactions and me

I’ve worked out its impossible to just memorise all of the new Dynamic Management View and Functions in SQL Server 2005; so my new approach is to actually use one or two and see what they do.

According to the documentation for sys.dm_tran_active_snapshot_database_transactions it returns “a virtual table for all active transactions that generate or potentially [...]