SELECT DEST.TEXT
FROM sys.[dm_exec_connections] SDEC
CROSS APPLY sys.[dm_exec_sql_text](SDEC.[most_recent_sql_handle]) AS DEST
WHERE SDEC.[most_recent_session_id] = (SELECT @@SPID)
SQL SERVER Performance – JSON vs XML
2 weeks ago
By:Chandrakant Hibare- Software Engineer,Working with Spain Based Company,Bangalore
SELECT DEST.TEXT
FROM sys.[dm_exec_connections] SDEC
CROSS APPLY sys.[dm_exec_sql_text](SDEC.[most_recent_sql_handle]) AS DEST
WHERE SDEC.[most_recent_session_id] = (SELECT @@SPID)
Is a string of Unicode character data. character_string is sysname and is limited to 128 characters. Inputs greater than 128 characters return NULL.
Is a one-character string to use as the delimiter. Can be a single quotation mark ( ' ), a left or right bracket ( [] ), or a double quotation mark ( " ). If quote_character is not specified, brackets are used.
Select
A
.
*
From
OPENROWSET
(
'MSDASQL'
,
'DRIVER={SQL SERVER};SERVER=name\instance;UID=user;PWD=password'
,
'SELECT * FROM pubs.dbo.authors'
)
AS
A
Where
A
.
MaintenanceDate <> MaintenanceDate
Select
A
.
*
From
OPENROWSET
(
'MSDASQL'
,
'Driver={SQL SERVER};SERVER=server\instance;UID=user;PWD=pass'
,
'SELECT * FROM database.dbo.table'
)
as
A
Right
Outer
Join
database
.
dbo
.
table
As
B
on
A
.
PlantID
=
B
.
PlantID
AND
A
.
RuleType
=
B
.
RuleType
AND
A
.
RulePrefix
=
B
.
RulePrefix
and
A
.
RuleSuffix
=
B
.
RuleSuffix
Where
A
.
MaintenanceDate <> B
.
MaintenanceDate