MERGE statement in SQL

It comes with 3 flavours:

    when matched – update or delete
    when not matched – insert – present in source NOT in target
    when not matched by source – present in target NOT in source, you can then update or delete

efficient than individual insert or delete

Interesting usage of PARSENAME() in SQL

— Limitation of only 3 DOTS or 4 max value
select parsename('my.name.is.admin', 4)
select parsename('my.name.is.admin', 3)
select parsename('my.name.is.admin', 2)
select parsename('my.name.is.admin', 1)

My Transaction Log is bloated…what do I do?

first take log backup
then it truncates tlog but the size wouldnt change
so then shrink the log file now

DBCC SHRINKFILE(pubs_log, 1)

Take recurrent full backups and all uncommitted transactions will be flushed out

Is SSIS Cluster aware?

SSIS services by default cannot handle named instances
SSIS also is not cluster-aware and is single instance application (i.e. only one copy of SSIS can run on server at a time).

How do you identify CPU Pressure in SQL Server ?

— Total waits are wait_time_ms (high signal waits indicates CPU pressure)
SELECT signal_wait_time_ms=SUM(signal_wait_time_ms)
,'signal (cpu) waits' = CAST(100.0 * SUM(signal_wait_time_ms) / SUM (wait_time_ms) AS NUMERIC(20,2))
,resource_wait_time_ms= SUM(wait_time_ms - signal_wait_time_ms)
,'%resource waits'= CAST(100.0 * SUM(wait_time_ms - signal_wait_time_ms) / SUM (wait_time_ms) AS NUMERIC(20,2))
FROM sys.dm_os_wait_stats

-- Check SQL Server Schedulers to see if they are waiting on CPU
-- If the runnable task count is above 10 for multiple schedulers, you are experiencing CPU pressure.
SELECT scheduler_id, current_tasks_count, runnable_tasks_count
FROM sys.dm_os_schedulers
WHERE scheduler_id < 255