Tips for using SQL Server 2017 file and filegroups Consider placing the log files on other physical disk arrays than those with the data files. Because logging is usually more write-intensive, it’s important that the disk arrays containing the SQL Server log files have sufficient disk I/O performance. Do not create many data and log files on the same physical...
Author: Alexander Chigrik
Some tips for using tempdb database in SQL Server 2017
Some tips for using tempdb database in SQL Server 2017 Set the reasonable size for the tempdb database and transaction log. First of all you should estimate how large your tempdb database will be. To estimate the reasonable database size, you should estimate the size of each table individually, add some additional space (10-20%) and then add the values obtained....
Tips for using SQL Server 2017 cursors
Tips for using SQL Server 2017 cursors Use READ ONLY cursors, whenever possible, instead of updatable cursors. Because using cursors can reduce concurrency and lead to unnecessary locking, try to use READ ONLY cursors, if you do not need to update cursor result set. Try to avoid using SQL Server cursors, whenever possible. SQL Server cursors can results in some...
Tips for using backup and restore in SQL Server 2017
Tips for using backup and restore in SQL Server 2017 Consider storing the backup files on physical disks on another computer. Storing the backup files on the same computer where the databases stores may cause problem with restoring databases if the physical disks were damaged. Try to separate your database to different files and filegroups to backing up only appropriate...
Some tips for using XML in SQL Server 2017
Some tips for using XML in SQL Server 2017 Consider using the XML data type. This data type is used to store XML documents in table columns or Transact-SQL variables. The XML data type can be used in variables, columns, or in stored procedure and function parameters. Use the XQuery value() method instead of the query() method when you want...
Tips for using SQL Server 2017 triggers
Tips for using SQL Server 2017 triggers Try to use CHECK constraints instead of triggers whenever possible. Constraints are much more efficient than triggers and can boost performance. Constraints are also more consistent and reliable in comparison with triggers, because you can make errors when you write your own code to perform the same actions as the constraints. So, you...
Tips for using constraints in SQL Server 2017
Tips for using constraints in SQL Server 2017 Use cascading referential integrity constraints instead of triggers whenever possible. For example, if you need to make cascading deletes or updates, specify the ON DELETE or ON UPDATE clause in the REFERENCES clause of the CREATE TABLE or ALTER TABLE statement. The cascading referential integrity constraints are much more efficient than triggers...
Tips for using bulk copy in SQL Server 2017
Tips for using bulk copy in SQL Server 2017 Consider using BULK INSERT to insert data from files stored in Azure Blob storage. Beginning with SQL Server 2017 BULK INSERT command enable access data directly from a file specified as CSV format, and from files stored in Azure Blob storage through the new BLOB_STORAGE option of EXTERNAL DATA SOURCE. Use...
Tips for using Very Large Databases in SQL Server 2017
Tips for using Very Large Databases in SQL Server 2017 Create a user-defined filegroup and create some tables in it to run maintenance tasks (backups, DBCC, update statistics, and so on) against these tables. You can place a table in its own filegroup and can backup and restore only this table. So you can group user objects with similar maintenance...
Tips for using SQL Server 2017 Reporting Services
Tips for using SQL Server 2017 Reporting Services SQL Server 2017 Reporting Services (SSRS) is no longer available to install through SQL Server 2017 setup. You can download SSRS 2017 at here: https://www.microsoft.com/en-us/download/details.aspx?id=55252 Consider using the Microsoft Excel rendering extension. SQL Server 2017 Reporting Services supports the Reporting Services Excel rendering extension. This extension renders a report as an Excel...