Problem

The GROUP BY clause in SQL Server allows grouping of rows of a query. Generally, GROUP BY is used with an aggregate SQL Server function, such as SUM, AVG, etc. In addition, the GROUP BY can also be used with optional components such as Cube, Rollup and Grouping Sets. In this tip, I will demonstrate various ways of building a GROUP BY along with output explained.

Solution

When building queries for reports, we often use the GROUP BY clause. There are also cases where having subtotals and totals as part of the output is helpful and this is where we will use the optional operators like: CUBE, ROLLUP and GROUING SETS. …


Sisteminizde bulunan MSSQL veritabanlarının disk kullanım durumlarına yönelik yapacağınız kontroller için aşağıdaki scripti kullanabilirsiniz.

CREATE TABLE #FileSize
(dbName NVARCHAR(128),
FileName NVARCHAR(128),
type_desc NVARCHAR(128),
CurrentSizeMB DECIMAL(10,2),
FreeSpaceMB DECIMAL(10,2)
);

INSERT INTO #FileSize(dbName, FileName, type_desc, CurrentSizeMB, FreeSpaceMB)
exec sp_msforeachdb
‘use [?];
SELECT DB_NAME() AS DbName,
name AS FileName,
type_desc,
size/128.0 AS CurrentSizeMB,
size/128.0 — CAST(FILEPROPERTY(name, ‘’SpaceUsed’’) AS INT)/128.0 AS FreeSpaceMB
FROM sys.database_files
WHERE type IN (0,1);’;

SELECT *
FROM #FileSize
WHERE dbName NOT IN (‘distribution’, ‘master’, ‘model’, ‘msdb’) -- AND FreeSpaceMB > 500
order by FreeSpaceMB desc;
DROP TABLE #FileSize;
Alıntıdır: sqlshack.com

DROP TABLE #FileSize;

Alıntıdır: sqlshack.com


Sizinde SQL Management Studio ile çalışırken tablar arası geçişte ekranınız refresh olmuyorsa sizinle aynı problemi paylaşıyoruz demektir.

Bunun çözümü için şu adreste yer alan adımları izlemek yeterli oluyor.

TOOLS -> OPTIONS -> ENVIRONMENT -> GENERAL

Then untick the following 2 checkboxes:
Automatically adjust visual experience based on client performance
Use hardware graphics acceleration if available.

Birol Topuz

Yeni ol, önde ol. Eseriniz sizi yansıtsın!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store