Stored Procedure Error Logging Create table to capture Errors Create Stored Procedure to Log Error Invoke Stored Procedure in TRY/CATCH Block USE TEMPDB; GO IF OBJECT_ID(‘APM.ErrorLog’) IS NOT NULL DROP TABLE APM.ErrorLog; GO CREATE TABLE APM.ErrorLog ( ErrorLogID INT IDENTITY(1, 1) PRIMARY KEY, DatabaseID INT, …
Memory-Optimized Tables
Monitor Memory Optimized Table Space Usage : ; WITH system_allocated_memory ( system_allocated_memory_in_mb ) AS ( SELECT ISNULL(( SELECT CONVERT(DECIMAL(18, 2), ( SUM(TMS.memory_allocated_for_table_kb) + SUM(TMS.memory_allocated_for_indexes_kb) ) / 1024.00) FROM [sys].[dm_db_xtp_table_memory_stats] TMS WHERE TMS.object_id <= 0 ), 0.00) ), table_index_memory ( table_used_memory_in_mb, table_unused_memory_in_mb, index_used_memory_in_mb, index_unused_memory_in_mb ) AS …
Brute force attack on SQL Server
Brute force attack on SQL Server If your business needs the SQL Server to be accessible on public network, you may be very vulnerable for brute force attacks. Following query will help you identify the failed login attempts and you can further understand where the …
When Does SQL Server Trial Edition Expire?
When Does SQL Server Trial Edition Expire? I installed SQL Server Docker Container on Linux Machine running on EC2. I took the AMI Image and launched the existing container and wanted to know when will the SQL Server licence expires on Docker container. It expires …
SQL Injection attack on Website hosted on EC2 Machine
SQL Injection attack on Website hosted on EC2 Machine: I setup a website http://h1bsalary.online with publicly available dataset. As soon as I launched website, numerous trolls and automated bots sending traffic to identify the vulnerabilities. Safe-Guards I have taken so far : Provisioned Least privileged accounts to …
Install SQL Server Docker Container on Linux
Install SQL Server Docker Container on Linux and Connect through Client Tools I was surprised by ability to run setup and run SQL Server Docker container. It only takes about 2 commands and 2 Minutes. $docker pull microsoft/mssql-server-linux $docker run -e ‘ACCEPT_EULA=Y’ -e ‘SA_PASSWORD=Password’ -p 1433:1433 …
SQL Server Optimizations for High Concurrency
SQL Server Optimizations for High Concurrency Our business needs very robust, low latency, highly available and durable online transactional system which supports high concurrency for about four weeks in a year. It’s almost like Thanksgiving sale where you mark down very popular item (think of iPhone ) by …
ScriptOut Change Tracking Tables
ScriptOut Change Tracking Tables SELECT sys.schemas.name AS Schema_name , sys.tables.name AS Table_name , ‘ALTER TABLE ‘ + QUOTENAME(sys.schemas.name) + ‘.’ + QUOTENAME(sys.tables.name) + ‘ ENABLE CHANGE_TRACKING WITH (TRACK_COLUMNS_UPDATED = ON) ‘ + CHAR(13) AS SQLScript FROM sys.change_tracking_tables JOIN sys.tables ON sys.tables.object_id = sys.change_tracking_tables.object_id JOIN sys.schemas …
How to become DBA favorite Developer
Application Name : When a connection is made to SQL Server there are by default no way for SQL Server to know what software is making the connection. If several apps are using a shared SQL Server and there are problems caused by a certain …
AWS RDS First Touch Penalty
AWS RDS First Touch Penalty According to AWS Documentation The first time a DB instance is started and accesses an area of disk for the first time, the process can take longer than all subsequent accesses to the same disk area. This is known as …