Skip to content

Instantly share code, notes, and snippets.

View jjradha's full-sized avatar

Marcello Miorelli jjradha

View GitHub Profile
<Krishna>IF 'my_server' &lt;&gt; @@ServerName THROW 50001, 'Wrong Server!!!',1 </Krishna>
<Krishna>GO</Krishna>
<Krishna>use [DB_02]</Krishna>
<Krishna>GO</Krishna>
<Krishna>IF EXISTS (SELECT 'Radhe' FROM sys.triggers t wHERE t.[name] = 'tgr_repl_AuPair_Insert' AND CASE WHEN t.parent_id = 0 THEN t.parent_id ELSE object_id('[sub].[repl_Aupair]') END = t.parent_id )
</Krishna>
<Krishna>EXEC('BEGIN DROP TRIGGER [sub].[tgr_repl_AuPair_Insert] END') </Krishna>
<Krishna>GO</Krishna>
<Krishna></Krishna>
<Krishna>CREATE TRIGGER [sub].[tgr_repl_AuPair_Insert]</Krishna>
DBCC results for 'test1'.
Service Broker Msg 9675, State 1: Message Types analyzed: 14.
Service Broker Msg 9676, State 1: Service Contracts analyzed: 6.
Service Broker Msg 9667, State 1: Services analyzed: 3.
Service Broker Msg 9668, State 1: Service Queues analyzed: 3.
Service Broker Msg 9669, State 1: Conversation Endpoints analyzed: 0.
Service Broker Msg 9674, State 1: Conversation Groups analyzed: 0.
Service Broker Msg 9670, State 1: Remote Service Bindings analyzed: 0.
Service Broker Msg 9605, State 1: Conversation Priorities analyzed: 0.
DBCC results for 'sys.sysrscols'.
**Priority 10: Performance**:
- DBCC SHRINK% Ran Recently - The user MMiorelli has run file shrinks 2 times between Oct 29 2018 7:51PM and Oct 29 2018 7:51PM. So, uh, are they trying cause bad performance on purpose?
**Priority 50: DBCC Events**:
- Overall Events - 2 DBCC events have taken place between Oct 29 2018 7:51PM and Oct 29 2018 7:51PM. This does not include CHECKDB and other usually benign DBCC events.
ALTER PROCEDURE [repl].[usp_upd_repl_out_application]
(
@applicationId int
)
AS
BEGIN
BEGIN TRAN
BEGIN TRY
@jjradha
jjradha / gist:33da769204e5855bcc92ccab68f114b8
Created June 16, 2017 06:28
the error log while tring to connect using teamviewer - Connection to 419600239 denied, because remote TeamViewer is not visible
2017/06/16 07:20:57.826 4204 4208 S0 SERVICE_CONTROL_SESSIONCHANGE session=1, statusCode=WTS_SESSION_UNLOCK
2017/06/16 07:21:02.608 4204 5052 S0 CAcceptServer::HandleAccept: new connection from 127.0.0.1:51961
2017/06/16 07:21:02.608 4204 5052 S0 TerminalServer: ProcessConnected PID 6596 user session 1 process type 2
2017/06/16 07:21:02.623 4204 5052 S0 CInterProcessNetwork::SetDyngateIDforSession() id=420038999 session=1 ptype=2
2017/06/16 07:21:02.623 4204 5052 S0 UpdateOnlineState newOnlineValue 1
2017/06/16 07:21:02.623 4204 8640 S0 TeamViewer is going online!
2017/06/16 07:21:02.623 4204 5064 S0 CKeepAliveClientClient::DoReconnectInternal: doing nothing, state = 0
2017/06/16 07:21:02.623 4204 5060 S0 Activating Router carrier
2017/06/16 07:21:02.154 6596 652 G1 Logger started.
2017/06/16 07:21:02.154 6596 652 G1 StringCompare locale: Italian_Italy.1252
<?xml version="1.0" encoding="utf-16"?>
<ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.3.1" Build="12.0.5000.0" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="3" StatementEstRows="2.55412" StatementId="1" StatementOptmLevel="FULL" StatementOptmEarlyAbortReason="TimeOut" CardinalityEstimationModelVersion="120" StatementSubTreeCost="7.96175" StatementText="SELECT o.strBxOrderNo,&#xD;&#xA; i.sintOrderSeqNo,&#xD;&#xA; r.decReturnGoodsNetAmount,&#xD;&#xA; r.decReturnGoodsTaxAmount,&#xD;&#xA; r.decReturnShippingNetAmount,&#xD;&#xA; r.decReturnShippingTaxAmount,&#xD;&#xA; r.decReturnTotalAmount,&#xD;&#xA; r.decBCReturnGoodsNetAmount,&#xD;&#xA; r.decBCReturnGoodsTaxAmount,&#xD;&#xA; r.decBCReturnShippingNetAmount,&#xD;&#xA; r.decBCReturnShippingTaxAmount,&#xD;&#xA; r.decBCReturnTotalAmount,&#xD;&#xA; r.blnManual,&#xD;&#xA; r.bl
@jjradha
jjradha / gist:2596ec42bbb4d3d5e8e7618797007e25
Created October 20, 2016 16:53
warning on the sort operator
<?xml version="1.0" encoding="utf-16"?>
<ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.3.1" Build="12.0.5000.0" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="3" StatementEstRows="1.4925" StatementId="1" StatementOptmLevel="FULL" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="70" StatementSubTreeCost="0.0285251" StatementText="SELECT DISTINCT&#xD;&#xA; a.strAccountCode ,&#xD;&#xA; a.strAddressLine6 ,&#xD;&#xA; a.strPostalCode ,&#xD;&#xA; CASE WHEN a.strCountryCode IN ('91','92') THEN 'GB-Int'&#xD;&#xA; ELSE a.strCountryCode&#xD;&#xA; END AS [strCountryCode]&#xD;&#xA; FROM Bocss2.dbo.tblBAccountParticipant AS ap&#xD;&#xA; INNER JOIN Bocss2.dbo.tblBAccountParticipantAddress AS apa ON ap.lngParticipantID = apa.lngParticipantID&#xD;&#xA; AND apa.sintAdd
<?xml version="1.0" encoding="utf-16"?>
<ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.2" Build="12.0.2000.8" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="1" StatementEstRows="15" StatementId="1" StatementOptmLevel="TRIVIAL" CardinalityEstimationModelVersion="120" StatementSubTreeCost="0.0032985" StatementText="select [name] from italian_cities&#xD;&#xA;order by [name] desc" StatementType="SELECT" QueryHash="0xDAAE8C127A4785E4" QueryPlanHash="0xB60E0157D0A84290" RetrievedFromCache="true">
<StatementSetOptions ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" NUMERIC_ROUNDABORT="false" QUOTED_IDENTIFIER="true" />
<QueryPlan DegreeOfParallelism="1" CachedPlanSize="16" CompileTime="0" CompileCPU="0" CompileMemory="88">
<MemoryGrantInfo SerialReq
<?xml version="1.0" encoding="utf-16"?>
<ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.2" Build="12.0.2000.8" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="7" StatementEstRows="1000070" StatementId="1" StatementOptmLevel="FULL" CardinalityEstimationModelVersion="120" StatementSubTreeCost="24.5016" StatementText="select t.*&#xD;&#xA;from RADHE_01 t&#xD;&#xA;where t.MYXML.exist('*') = 0 OR t.MYXML IS NULL" StatementType="SELECT" QueryHash="0x78CFEF157D3D2516" QueryPlanHash="0x831670FA8C31EE5A" RetrievedFromCache="true">
<StatementSetOptions ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" NUMERIC_ROUNDABORT="false" QUOTED_IDENTIFIER="true" />
<QueryPlan DegreeOfParallelism="1" CachedPlanSize="24" CompileTime="1" CompileCPU="1" CompileMemory="312">
<?xml version="1.0" encoding="utf-16"?>
<ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.2" Build="12.0.2000.8" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="10" StatementEstRows="1" StatementId="1" StatementOptmLevel="FULL" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="70" StatementSubTreeCost="0.00657344" StatementText="SELECT TOP 1 ISNULL(pst.TaxCode, '') as TaxCode&#xD;&#xA; , ISNULL(pst.TaxRate, 0) as TaxRate&#xD;&#xA;FROM dbo.[ProductShipTax] pst&#xD;&#xA;WHERE EXISTS (&#xD;&#xA;&#xD;&#xA; SELECT TaxRegionId&#xD;&#xA; FROM dbo.[ShipTaxAddress]&#xD;&#xA; WHERE [CountryCode] = @countryCode&#xD;&#xA; AND [AddressFormatID] = @addressFormatID&#xD;&#xA;&#xD;&#xA; AND ([MatchAddressLine1] = @AddressLine1 OR ([MatchAddressLine1] IS NULL AND @AddressLine1 IS NULL) )&