Step 1: Create the view
Step 2: Join with sys.sysdatabases and sys.dm_exec_connections check the connection details
csmart,
2018-12-19 (first published: 2018-11-27)
Step 1: Create the view
Step 2: Join with sys.sysdatabases and sys.dm_exec_connections check the connection details
CREATE view [dbo].[sqlexec] as with SQLExec as (SELECT s.spid,db_name(s.dbid) as dbname,s.login_time,s.last_batch,s.hostname, s.loginame, s.program_name,s.waittype,s.lastwaittype,s.cmd,s.blocked,s.cpu,s.memusage,s.physical_io,s.status,s.net_library,s.sql_handle ,e.text as SQL,e.encrypted as IsSQLTextEncrypted FROM sys.sysprocesses s CROSS APPLY sys.dm_exec_sql_text(s.sql_handle) AS e) select e.*,conn.auth_scheme,conn.client_net_address,conn.connect_time,conn.encrypt_option as IsSQLConnectionEncrypted,conn.net_transport from SQLExec e join sys.dm_exec_connections conn with (nolock) on e.spid = conn.session_id
2012-04-17 (first published: 2008-02-15)
6,188 reads
2017-02-28
8,491 reads
In this article, we will learn how to use Visual Studio to query Azure SQL Data Warehouse tables and how to create a new table.
2017-01-25
2,591 reads
When we administer a SQL Database, we always have to work with files. This new article shows how to handle them using PowerShell.
2016-10-04
2,822 reads
SQL Server database developers seem reluctant to use diagrams when documenting their databases. It is probably because it has, in the past, been difficult to automatically draw precisely what you want, other than a vast Entity-relationship diagram. However, you can do it without buying any third-party tool, just using some existing Java-based open-source tools; and can even automate it entirely, using SQL and PowerShell. Phil Factor shows how.
2016-05-27
5,062 reads