Viewing 15 posts - 46 through 60 (of 60 total)
Rewrote that Create View sample code to be a CTE :w00t:
;WITH all_task_usage
AS (
SELECT session_id,
SUM(internal_objects_alloc_page_count) AS tsk_intobj_alloc_pgcnt,
...
June 14, 2012 at 7:38 am
this might be nice to collect off somewhere...
SELECT
cast(SUM(unallocated_extent_page_count) as bigint) as 'Free Unallocated',
cast(SUM(version_store_reserved_page_count) as bigint) as 'version store resv...
June 14, 2012 at 7:32 am
I wouldn't believe anything from just one source. Troubleshooting memory bottlenecks means either you are encountering some performance issues or server problems you have associated by analysis to lack of...
June 13, 2012 at 8:29 am
Something like this...
BEGIN TRY
INSERT INTO destinationTable
SELECT cast(substring(Column1,1,12) as nvarchar(12)),
cast(substring(Column2,1,10) as nvarchar(10)),
cast(Column3 as int),
cast(Column4...
June 12, 2012 at 3:45 pm
ETL = 3 steps.
1. Export to the target server. For this I would create your own copy of the source servers table structure and move records from source to...
June 12, 2012 at 2:44 pm
Scan your databases code for a reference to the table or the alter command
SELECT sm.object_id, OBJECT_NAME(sm.object_id) AS object_name, o.type, o.type_desc, sm.definition
FROM sys.sql_modules AS sm
JOIN sys.objects AS o ON sm.object_id =...
June 12, 2012 at 2:13 pm
SQL server only resorts to doing parallel plan processing for an Update statement when there is a WHERE clause. I thought your orignial query did not even use a where...
June 12, 2012 at 12:49 pm
SELECT TOP 25 A.name,(SELECT rows FROM dbo.sysindexes s WITH (NOLOCK)
WHERE s.indid < 2 AND s.id = A.ID )AS [Row count],SpaceUsedMB from
(SELECTSO.NAME,SO.ID,
CONVERT(numeric(15,2),(((CONVERT(numeric(15,2),SUM(i.reserved)) * (SELECT low
FROM master.dbo.spt_values WITH...
June 12, 2012 at 11:59 am
In today's corporate environment you have to manage your own DBA career. Now I am not knowledgable about your current role and company but I have mentored, managed and...
June 12, 2012 at 7:49 am
SELECT
DB_NAME(database_id) as [dbname],
CASE file_id
WHEN 1 THEN 'Data'
WHEN 2 THEN 'Log'
ELSE 'DATA'
END as [File_type] ,
num_of_reads as [Reads],
num_of_bytes_read/1024/1024 as...
June 12, 2012 at 7:21 am
create table Zips (Zip int, City [varchar](36) null, StateCode [varchar](2) NULL, County [varchar](36) null)
insert into Zips values (75056, 'Dallas', 'TX', 'Dallas');
insert into Zips values (75057, 'Irving', 'TX', 'Dallas');
insert into Zips...
June 8, 2012 at 3:48 pm
just 2cents...
I'd investigate if the VM Hosts have local drives. Because if so, then you can definately speed up backup time by backing up to the Host's drives that a...
June 8, 2012 at 11:48 am
--
SELECT usecounts, cacheobjtype, objtype, size_in_bytes/1024 as 'Size(KB)', TEXT
FROM sys.dm_exec_cached_plans
CROSS APPLY sys.dm_exec_sql_text(plan_handle)
WHERE usecounts = 1 and objtype = 'Adhoc'
ORDER BY size_in_bytes/1024 DESC;
--
SELECT q.[text],
(highest_cpu_queries.total_worker_time/highest_cpu_queries.execution_count) / 1000000.0 AS AverageCPU,
highest_cpu_queries.execution_count as distinctCalls,...
June 8, 2012 at 11:14 am
;WITH IndexSpaceUsed
as (
SELECT OBJECT_NAME(object_id) as ObjName
,SUM(reserved_page_count) as ResPgCnt
,SUM(used_page_count) as UsedPgCnt
,SUM(CASE
WHEN (index_id < 2) THEN (in_row_data_page_count + lob_used_page_count + row_overflow_used_page_count)
ELSE lob_used_page_count + row_overflow_used_page_count
END) as Pages
,SUM(CASE
WHEN (index_id...
June 8, 2012 at 10:46 am
SELECT OBJECT_SCHEMA_NAME(I.OBJECT_ID) AS SchemaName,
OBJECT_NAME(I.OBJECT_ID) AS ObjectName,
I.NAME AS IndexName, I.type_desc as IdxType, ips.record_count,
(ips.record_count * ips.avg_record_size_in_bytes)/1024/1024 as 'Size(MB)'
FROM sys.indexes I
INNER JOIN sys.dm_db_index_physical_stats ( DB_ID(), NULL, NULL, NULL, 'DETAILED')...
June 8, 2012 at 10:24 am
Viewing 15 posts - 46 through 60 (of 60 total)