In the last few years, JSON has positioned itself as a standard data exchange format between services, although XML is still widely used. In the SQL Server 2016, Microsoft implemented JSON support directly in the database engine, and the capabilities of data manipulation are increasing in each following version.Read More
Dynamic SQL is a statement constructed and executed at runtime, usually containing dynamically generated SQL string parts, input parameters, or both.
Various methods are available to construct and run dynamically generated SQL commands. The current article is going to explore them, define their positive and negative aspects, and demonstrate practical approaches to optimize queries in some frequent scenarios.
We use two ways to execute dynamic SQL: EXEC command and sp_executesql stored procedure.Read More
Daily work rarely requires storing binary data directly to database columns. However, it is very useful in some cases.
Contrary to popular opinion, byte arrays can help with significantly more than just storing large binary objects (documents, multimedia, etc.). Also, they can be used to store hash values and sample data for faster searching/high-level analysis. Or, they might contain bytes that are in ON/OFF states in some electronic relay. As soon as we start to think about hardware data stored in databases, applications become more apparent.Read More
No matter how hard we try to design and develop applications, errors will always occur. There are two general categories – syntax or logical errors can be either programmatic errors or consequences of incorrect database design. Otherwise, you might get an error because of the wrong user input.Read More
Have you ever been asked about creating arrays in SQL Server? Processing an array of values inside a procedure/ function in SQL is a common requirement. The question arises quite often, especially if you deal with Oracle specialists because Oracle has arrays. But the thing is, SQL Server does not have this.
Still, what if we need this functionality in the SQL Server environment? Fortunately, there are ways to resolve the issue. In this article, I am going to explain the most efficient alternatives to array in SQL Server.Read More