DataSunrise Achieves AWS DevOps Competency Status in AWS DevSecOps and Monitoring, Logging, Performance

How to Audit Microsoft SQL Server

Auditing is an essential part of database governance. Whether you're protecting financial records, healthcare data, or internal logs, SQL Server offers native capabilities—and those can be extended with platforms like DataSunrise. This guide explores how to audit Microsoft SQL Server using both native tools and external solutions while maintaining visibility over sensitive data and access control.

Microsoft SQL Server includes a broad range of security and audit options across its editions. Auditing begins with knowing what to log, where to store it, and how to alert stakeholders. The official SQL Server auditing documentation lays out the foundation.

If you're handling financial transactions or medical records, aligning your audits with regulations like GDPR or HIPAA is a must. A full checklist is available via Microsoft’s security center.

To understand where sensitive data exists in your environment, use DataSunrise's discovery capabilities early in your process.

How to Native Audit Microsoft SQL Server

Auditing SQL Server natively is done using CREATE SERVER AUDIT and AUDIT SPECIFICATION objects. These tools allow precise monitoring of logins, data access, permission changes, and schema modifications—all without third-party tools.

Here's how to start:

CREATE SERVER AUDIT Audit_SQL_Logs
TO FILE (FILEPATH = 'D:\AuditLogs\');
GO

CREATE SERVER AUDIT SPECIFICATION Audit_Logins
FOR SERVER AUDIT Audit_SQL_Logs
ADD (SUCCESSFUL_LOGIN_GROUP),
ADD (FAILED_LOGIN_GROUP);
GO

ALTER SERVER AUDIT Audit_SQL_Logs WITH (STATE = ON);
GO

Add a database-level audit for sensitive table access:

CREATE DATABASE AUDIT SPECIFICATION AuditSensitiveData
FOR SERVER AUDIT Audit_SQL_Logs
ADD (SELECT ON OBJECT::dbo.Patients BY public)
WITH (STATE = ON);
GO

The results can be viewed using:

SELECT * FROM sys.fn_get_audit_file('D:\AuditLogs\*', default, default);

This native setup captures who accessed what and when, which is critical for monitoring exposure of sensitive data. SQL Server also offers built-in dynamic data masking to obscure sensitive fields at runtime.

Key Features of Native Auditing

  • No external dependencies

  • Available in Enterprise Edition and partially in Standard

  • Integrated with Windows security events

However, native auditing lacks flexibility for large-scale compliance operations. That's where DataSunrise offers deeper value.

How to Audit Microsoft SQL Server with DataSunrise

DataSunrise acts as a transparent proxy for Microsoft SQL Server. It logs every query, applies audit rules, and forwards events to external systems. Here's how to configure it step-by-step:

Step 1: Add SQL Server to DataSunrise

Log in to the management console and navigate to DB Instances. Choose Add New, select Microsoft SQL Server, and enter the following:

  • Connection name

  • SQL Server IP or hostname

  • Port (default is 1433)

  • Credentials (read-only access is sufficient for audit purposes)

How to Audit Microsoft SQL Server - Architecture diagram showing how server and database audit specifications generate logs routed to audit, application, and event outputs
Proxy configuration form in DataSunrise for defining ports and SSL settings for secure SQL traffic inspection

Step 2: Enable Reverse Proxy Mode

Set up a listener on a new port (e.g., 15433). This redirects client traffic through DataSunrise, allowing full visibility without modifying SQL Server itself. More on reverse proxy mode here.

Step 3: Configure Audit Rules

Go to AuditRules and click Create Rule. You can:

  • Log query text, schema, and timestamp

  • Target users/groups/roles

  • Limit by time of day or query type

Apply rule priorities to fine-tune how events are processed.

How to Audit Microsoft SQL Server - Proxy configuration form in DataSunrise for defining ports and SSL settings for secure SQL traffic inspection
SQL injection rule configuration in DataSunrise audit module with penalties for risky patterns such as comments, unions, and constants

Step 4: Set Up Log Management

Audit logs in DataSunrise can be:

Each log contains user, host, SQL text, latency, and result code. Use report generators for periodic exports.

Step 5: Add Compliance Context

Go to Compliance Manager and link your audit policies to GDPR, SOX, or PCI DSS templates. DataSunrise highlights untracked areas or weak audit coverage using automated compliance reports.

For example, you can flag missing logs for SELECTs on tables storing PII—helping stay compliant with GDPR.

Why Choose DataSunrise for SQL Server Audit?

  • Works with on-prem and cloud SQL Server

  • Does not require changes to existing databases

  • Offers real-time threat detection based on query behavior (behavior analytics)

If you want to go deeper, the DataSunrise audit guide walks through advanced configurations.

How to Audit Microsoft SQL Server - SQL injection rule configuration in DataSunrise audit module with penalties for risky patterns such as comments, unions, and constants
Architecture diagram showing how server and database audit specifications generate logs routed to audit, application, and event outputs

Summary

Auditing Microsoft SQL Server doesn’t have to be complex. You can start with built-in SQL features and scale up to DataSunrise for full coverage across sensitive data, user activity, and regulatory alignment.

From simple audit logs to full automation with compliance reports, choosing the right tools makes all the difference.

Try the DataSunrise Demo to see how it works live, or explore more in the deployment modes section to match your infrastructure.

Previous

What Is Microsoft SQL Server Audit Trail

Learn More

Need Our Support Team Help?

Our experts will be glad to answer your questions.

Countryx
United States
United Kingdom
France
Germany
Australia
Afghanistan
Islands
Albania
Algeria
American Samoa
Andorra
Angola
Anguilla
Antarctica
Antigua and Barbuda
Argentina
Armenia
Aruba
Austria
Azerbaijan
Bahamas
Bahrain
Bangladesh
Barbados
Belarus
Belgium
Belize
Benin
Bermuda
Bhutan
Bolivia
Bosnia and Herzegovina
Botswana
Bouvet
Brazil
British Indian Ocean Territory
Brunei Darussalam
Bulgaria
Burkina Faso
Burundi
Cambodia
Cameroon
Canada
Cape Verde
Cayman Islands
Central African Republic
Chad
Chile
China
Christmas Island
Cocos (Keeling) Islands
Colombia
Comoros
Congo, Republic of the
Congo, The Democratic Republic of the
Cook Islands
Costa Rica
Cote D'Ivoire
Croatia
Cuba
Cyprus
Czech Republic
Denmark
Djibouti
Dominica
Dominican Republic
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Ethiopia
Falkland Islands (Malvinas)
Faroe Islands
Fiji
Finland
French Guiana
French Polynesia
French Southern Territories
Gabon
Gambia
Georgia
Ghana
Gibraltar
Greece
Greenland
Grenada
Guadeloupe
Guam
Guatemala
Guernsey
Guinea
Guinea-Bissau
Guyana
Haiti
Heard Island and Mcdonald Islands
Holy See (Vatican City State)
Honduras
Hong Kong
Hungary
Iceland
India
Indonesia
Iran, Islamic Republic Of
Iraq
Ireland
Isle of Man
Israel
Italy
Jamaica
Japan
Jersey
Jordan
Kazakhstan
Kenya
Kiribati
Korea, Democratic People's Republic of
Korea, Republic of
Kuwait
Kyrgyzstan
Lao People's Democratic Republic
Latvia
Lebanon
Lesotho
Liberia
Libyan Arab Jamahiriya
Liechtenstein
Lithuania
Luxembourg
Macao
Madagascar
Malawi
Malaysia
Maldives
Mali
Malta
Marshall Islands
Martinique
Mauritania
Mauritius
Mayotte
Mexico
Micronesia, Federated States of
Moldova, Republic of
Monaco
Mongolia
Montserrat
Morocco
Mozambique
Myanmar
Namibia
Nauru
Nepal
Netherlands
Netherlands Antilles
New Caledonia
New Zealand
Nicaragua
Niger
Nigeria
Niue
Norfolk Island
North Macedonia, Republic of
Northern Mariana Islands
Norway
Oman
Pakistan
Palau
Palestinian Territory, Occupied
Panama
Papua New Guinea
Paraguay
Peru
Philippines
Pitcairn
Poland
Portugal
Puerto Rico
Qatar
Reunion
Romania
Russian Federation
Rwanda
Saint Helena
Saint Kitts and Nevis
Saint Lucia
Saint Pierre and Miquelon
Saint Vincent and the Grenadines
Samoa
San Marino
Sao Tome and Principe
Saudi Arabia
Senegal
Serbia and Montenegro
Seychelles
Sierra Leone
Singapore
Slovakia
Slovenia
Solomon Islands
Somalia
South Africa
South Georgia and the South Sandwich Islands
Spain
Sri Lanka
Sudan
Suriname
Svalbard and Jan Mayen
Swaziland
Sweden
Switzerland
Syrian Arab Republic
Taiwan, Province of China
Tajikistan
Tanzania, United Republic of
Thailand
Timor-Leste
Togo
Tokelau
Tonga
Trinidad and Tobago
Tunisia
Turkey
Turkmenistan
Turks and Caicos Islands
Tuvalu
Uganda
Ukraine
United Arab Emirates
United States Minor Outlying Islands
Uruguay
Uzbekistan
Vanuatu
Venezuela
Viet Nam
Virgin Islands, British
Virgin Islands, U.S.
Wallis and Futuna
Western Sahara
Yemen
Zambia
Zimbabwe
Choose a topicx
General Information
Sales
Customer Service and Technical Support
Partnership and Alliance Inquiries
General information:
info@datasunrise.com
Customer Service and Technical Support:
support.datasunrise.com
Partnership and Alliance Inquiries:
partner@datasunrise.com