Tags » SQL Server

Who's Locking The Table?

This is the script I use to view who/what is locking the table in SQL Server:

SELECT  l.request_session_id AS SessionID,
        o.Name AS 'Table Locked',
        DATEDIFF(second, at.Transaction_begin_time, GETDATE()) AS 'Duration (Seconds)',
        FORMAT(at.Transaction_begin_time, 'yyyy-mm-dd h:mm:ss tt') 'Started On',
        es.login_name 'User',
        es. 105 more words
SQL Server

Restoring an MDF/LDF from Another Machine

If you need to restore an MDF/LDF from one machine (source) into another machine (target), you copy the source’s MDF/LDF file to the target machine. Then start the target server in single user mode. 38 more words

SQL Server

SQL Server - Reading BACPAC Files

If you have been reading my blog for a while now you would know that a common technique to move to Azure SQL DB is to use BACPAC files. 151 more words

SQL SERVER

Better SSMS Objects Management with SQLTreeo

This is so cool and handy. You can hide and organize database objects (procs, tables, views, databases) in folders. This organization is saved locally to your machine, on a the server level, via extended properties. 24 more words

SQL Server

Importing Excel Data into SQL Server

Sometimes it can be a pain. Why? Because SSMS (or should I say SSIS) uses the Windows Excel driver, and it infers data types of the columns incorrectly, and will choke when you import. 140 more words

SQL Server

Contextual View Part II or how to hide sensitive data

Problem statement. I have already posted about contextual view pattern and correspondent use case. If you have not read it, please go ahead and read that post before continuing, because I will not repeat some of the conclusions and techniques used to hide the data based on the request context. 725 more words

Database Codding