Thursday, June 19, 2025

msdb Veri Tabanı - System Database

Giriş
Açıklaması şöyle
In SQL Server environments, system databases play crucial roles in ensuring smooth and reliable database operations. Among these, the msdb database is critical as it handles a variety of operational tasks, including job scheduling via SQL Server Agent, alert management, database mail configuration, and backup and restore history tracking. These functions are essential for automating routine maintenance, monitoring system health, and managing administrative workflows.
Açıklaması şöyle
msdb is a system database that stores metadata and configuration for:
  • SQL Server Agent jobs

  • Backup and restore history

  • Database mail

  • Service Broker

  • Log shipping

  • Maintenance plans

  • Alerts and operators

  • SSIS package storage (when using MSDB storage)

Sunday, April 6, 2025

Sütun Tipleri - REAL

Giriş
Açıklaması şöyle
- Equivalent to a 32-bit floating-point number (single precision)
- IEEE standard floating-point value (7-digit precision)
- Storage size: 4 bytes
- Synonym: FLOAT(24)

Sunday, February 16, 2025

ORDER BY + OFFSET + FETCH - Sayfalama İçindir

Örnek
SQL Server 2012 ve sonrasında şöyle yaparız
SELECT * FROM Employees ORDER BY EmployeeID ASC
OFFSET 10 ROWS         -- Skip the first 10 rows
FETCH NEXT 5 ROWS ONLY; -- Fetch the next 5 rows
Örnek
SQL Server 2008 ve öncesinde şöyle yapılır
SELECT TOP 5 *
FROM (
    SELECT *, ROW_NUMBER() OVER (ORDER BY EmployeeID ASC) AS RowNum
    FROM Employees
) AS SubQuery
WHERE RowNum > 10;




Monday, February 10, 2025

DROP DATABASE

Örnek
Force drop için şöyle yaparız
-- Set the database to SINGLE_USER mode with ROLLBACK IMMEDIATE to kill all connections
ALTER DATABASE my_new_db SET SINGLE_USER WITH ROLLBACK IMMEDIATE;

-- Drop the database
DROP DATABASE my_new_db;



Tuesday, January 14, 2025

CREATE NONCLUSTERED INDEX

Örnek
Şöyle yaparız
CREATE NONCLUSTERED INDEX IDX_MYINDEX
ON Orders(OrderDate, ProductID);

Query Store

Giriş
Açıklaması şöyle
The Query Store in SQL Server is a feature designed to help you monitor, troubleshoot, and optimize query performance by automatically capturing a history of queries, plans, and runtime statistics. It's essentially a performance monitoring and tuning tool built into SQL Server.
Örnek
Şöyle yaparız
ALTER DATABASE AdventureWorks SET QUERY_STORE = ON;

msdb Veri Tabanı - System Database

Giriş Açıklaması şöyle In SQL Server environments, system databases play crucial roles in ensuring smooth and reliable database operations...