SQL SERVER – One Trick of Handling Dynamic SQL to Avoid SQL Injection Attack?

SQL Server has so many things to learn and I always find it amazing. My conversations with customers often come up with security questions esp around SQL Injection. Many have claimed SQL Injection is a SQL Server problem. It takes quite some time for me to let them know there is nothing about SQL Server and SQL Injection. SQL Injection is an outcome of wrong coding practices. One of the recommendations I give is about not using Dynamic SQL. There might be some situations where you can’t avoid it. My only advice would be, avoid if possible. In this blog, I would demonstrate a SQL Injection problem due to dynamic SQL and a possible solution you can have.

Read More

SQL SERVER – FIX – Error 3201 – Cannot open backup device. Operating system error 3

This blog is in continuing to use the default values. Earlier this week I wrote a blog which talked about the failure of Create Database Command. Let see in this blog post how we can solve the error 3201.

While working on the reproduction of the issue, I changed the parameters and later realized that the backup database command was also failing. If you rely on the default values for folders that don’t exist, this will raise an error message as shown below.

Read More

SQL SERVER – Error: Msg 701, Level 17, State 103. There is insufficient system memory in resource

Talking and exploring In-Memory topics in SQL Server 2014 has been interesting to me. When I wrote the blog around table variable not being just an In-Memory structure, one of my course listener (SQL Server 2014 Administration New Features) pinged me on twitter to ask, if In-Memory OLTP was really In-Memory? Wouldn’t SQL Server like to swap the data or memory data to pagination file when there is memory pressure? I told them the concept of In-Memory is that data always resides in memory and the reason for a feature name “In-Memory OLTP”. Let us see how we can fix errors related to insufficient system memory.

Read More