Tips for using ASP.NET with SQL Server 2016 Set the TrustServerCertificate to False in the SQL Azure connection string. The TrustServerCertificate=False setting is recommended to help protect against man-in-the-middle attacks. Use the SQL Server .NET data provider to access SQL Server 2016 data using ADO.NET. Because using the SQL Server .NET data provider provides better performance in comparison with other...
Author: Alexander Chigrik
Some tips for using linked servers in SQL Server 2016
Some tips for using linked servers in SQL Server 2016 Try to avoid the ad hoc queries that use the OPENROWSET or the OPENDATASOURCE functions to access remote data. Create a linked server and perform a linked server’s query instead of using an ad hoc query with OPENROWSET or OPENDATASOURCE functions. Using the linked server’s queries to access remote data...
Tips for using Very Large Databases in SQL Server 2016
Tips for using Very Large Databases in SQL Server 2016 Try to create as many database files, as there are physical disk arrays so that you have one file per disk array. This will improve performance, because when a table is accessed sequentially, a separate thread is created for each file on each disk array in order to read the...
Some tips for designing SQL Server 2016 tables (Part 2)
Some tips for designing SQL Server 2016 tables (Part 2) Try to reduce the number of columns in a table. The fewer the number of columns in a table, the less space the table will use, since more rows will fit on a single data page, and less I/O overhead will be required to access the table’s data. Consider using...
Some tips for designing SQL Server 2016 tables (Part 1)
Some tips for designing SQL Server 2016 tables (Part 1) Avoid using timestamp column as a primary key. Timestamp is a data type that exposes automatically generated, unique binary numbers within a database. Every time that a row with a timestamp column is modified or inserted, the incremented database rowversion value is inserted in the timestamp column. This property makes...
Some tips for using temporary tables in SQL Server 2016
Some tips for using temporary tables in SQL Server 2016 Consider using system-versioned temporal tables. A system-versioned temporal table is a new type of user table in SQL Server 2016 that provides correct information about stored facts at any point in time. Each temporal table consists of two tables actually, one for the current data and one for the historical...
Useful Undocumented SQL Server 2016 Stored Procedures (Part 2)
Useful Undocumented SQL Server 2016 Stored Procedures (Part 2) SQL Server 2016 supports the following useful undocumented stored procedures: sp_oledb_database sp_oledb_defdb sp_oledb_deflang sp_oledb_language sp_syscollector_validate_xml sp_xml_schema_rowset sp_xml_schema_rowset2 sp_oledb_database The sp_oledb_database stored procedure returns the oledb database name. Syntax sp_oledb_database Return Code Values None. Result Sets Column name Type Description name sysname The name of the oledb database. Remarks This stored procedure...
Some tips for using SQL Server 2016 distributed queries
Some tips for using SQL Server 2016 distributed queries Try to avoid using distribution queries or minimize it using. Because distribution transactions incur more overhead than general transactions, avoid using distribution queries, whenever possible. The first steps to optimize distributed queries against a SQL Server 2016 linked server is rewriting queries so, that the most work will be performed on...
Some tips for using views in SQL Server 2016
Some tips for using views in SQL Server 2016 Use views to enhance security and conceal underlying data objects. For example, you can give to users the permission to access a view, which contain a restricted set of the columns and data, not allow selecting or updating the underlying data objects. By using views, the permission management could also be...
Some tips for using data types in SQL Server 2016
Some tips for using data types in SQL Server 2016 Use Date/Time data types to store date/time information separately. In SQL Server 2016 you can store the date and time information separately. For example, if you need to work with date data only, use the Date data type instead of datetime or smalldatetime to optimize storage space and simplify date […]