This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE PROCEDURE RecursiveTableList | |
@ParentID INT = NULL, | |
@Indent NVARCHAR(100) = '' | |
AS | |
BEGIN | |
SET NOCOUNT ON; | |
DECLARE @SQL NVARCHAR(MAX); | |
SET @SQL = ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @startDate datetime; | |
SET @startDate = GetDate(); | |
SELECT PVT.DatabaseName | |
, PVT.[0], PVT.[-1], PVT.[-2], PVT.[-3], PVT.[-4], PVT.[-5], PVT.[-6] | |
, PVT.[-7], PVT.[-8], PVT.[-9], PVT.[-10], PVT.[-11], PVT.[-12] | |
FROM | |
(SELECT BS.database_name AS DatabaseName | |
,DATEDIFF(mm, @startDate, BS.backup_start_date) AS MonthsAgo | |
,CONVERT(numeric(10, 1), AVG(BF.file_size / 1048576.0)) AS AvgSizeMB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DB.name AS Database_Name | |
,MAX(DB.recovery_model_desc) AS Recovery_Model | |
,MAX(BS.backup_start_date) AS Last_Backup | |
,MAX(CASE WHEN BS.type = 'D' | |
THEN BS.backup_start_date END) | |
AS Last_Full_backup | |
,SUM(CASE WHEN BS.type = 'D' | |
THEN 1 END) | |
AS Count_Full_backup | |
,MAX(CASE WHEN BS.type = 'L' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
db.name DBName, | |
tl.request_session_id, | |
wt.blocking_session_id, | |
OBJECT_NAME(p.OBJECT_ID) BlockedObjectName, | |
tl.resource_type, | |
h1.TEXT AS RequestingText, | |
h2.TEXT AS BlockingTest, | |
tl.request_mode | |
FROM sys.dm_tran_locks AS tl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select text, | |
SUBSTRING(st.text, (qs.statement_start_offset/2)+1, | |
((CASE qs.statement_end_offset | |
WHEN -1 THEN DATALENGTH(st.text) | |
ELSE qs.statement_end_offset | |
END - qs.statement_start_offset)/2) + 1) AS statement_text, | |
* from sys.dm_exec_requests qs | |
cross apply sys.dm_exec_sql_text(sql_handle) st | |
cross apply sys.dm_exec_query_plan(plan_handle); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT TOP 50 | |
ObjectName = OBJECT_SCHEMA_NAME(qt.objectid,dbid) + '.' + OBJECT_NAME(qt.objectid, qt.dbid) | |
,TextData = qt.text | |
,DiskReads = qs.total_physical_reads -- The worst reads, disk reads | |
,MemoryReads = qs.total_logical_reads --Logical Reads are memory reads | |
,Executions = qs.execution_count | |
,TotalCPUTime = qs.total_worker_time | |
,AverageCPUTime = qs.total_worker_time/qs.execution_count | |
,DiskWaitAndCPUTime = qs.total_elapsed_time | |
,MemoryWrites = qs.max_logical_writes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH DB_CPU_STATS_ON_INSTANCE | |
AS | |
(SELECT DatabaseID, DB_Name(DatabaseID) AS [DatabaseName], SUM(total_worker_time) AS [CPU_Time_Ms] | |
FROM sys.dm_exec_query_stats AS qs | |
CROSS APPLY (SELECT CONVERT(int, value) AS [DatabaseID] | |
FROM sys.dm_exec_plan_attributes(qs.plan_handle) | |
WHERE attribute = N'dbid') AS F_DB | |
GROUP BY DatabaseID) | |
SELECT ROW_NUMBER() OVER(ORDER BY [CPU_Time_Ms] DESC) AS [row_num], | |
DatabaseName, [CPU_Time_Ms], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var siteRoot = 'https://demo.com/' | |
var warningTime = '1' | |
function callSessionRefreshWebService() | |
{ | |
jQuery.ajax({ | |
type: "POST", | |
contenttype: "application/json; charset=utf-8", | |
data: "{}", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Uygulamam | |
{ | |
public class Tarih_islemleri | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT *,V.CHILD_NAME AS [Belge Adı],S.FILE_FORMAT AS [BELGE FORMATI],C.PAGE_COUNT AS [SAYFA SAYISI], (C.CONTENT_SIZE/1024) AS [DOSYA BOYUTU (Kb)] | |
from PW_VIRTUAL_DOCS V WITH (NOLOCK), [VW_T_MALI_ISLER_ARSIV] T WITH (NOLOCK) , PW_SYSOBJECT S WITH (NOLOCK), PW_CONTENT C WITH (NOLOCK) | |
WHERE T.OBJECT_ID=V.OBJECT_ID AND | |
V.CHILD_ID=S.OBJECT_ID AND | |
S.CONTENT_ID=C.CONTENT_ID AND | |
V.CONTENT_TYPE='D' |
NewerOlder