Category: SQL Server

Execute As Clause

In SQL Server you can define the execution context of the following user-defined modules: functions (except inline table-valued functions), procedures, queues, and triggers. By specifying the context in which the module is executed, you can control which user account the Database Engine uses to validate permissions on objects that are referenced by the module. This

Index Maintenance

SET NOCOUNT ON; DECLARE @objectid int; DECLARE @indexid int; DECLARE @partitioncount bigint; DECLARE @schemaname nvarchar(130); DECLARE @objectname nvarchar(130); DECLARE @indexname nvarchar(130); DECLARE @partitionnum bigint; DECLARE @partitions bigint; DECLARE @frag float; DECLARE @command nvarchar(4000); DECLARE @dbid smallint; — Conditionally select tables and indexes from the sys.dm_db_index_physical_stats function — and convert object and index IDs to names.

Columnstore Index Restrictions

Although columnstore indexes work with the majority of the data types, components, and features found in SQL Server 2012, columnstore indexes have the following restrictions and cannot be leveraged in the following situations: • You can enable PAGE or ROW compression on the base table, but you cannot enable PAGE or ROW compression on the

Columnstore Index Support and SQL Server 2012

Columnstore indexes and batch-query execution mode are deeply integrated in SQL Server 2012, and they work in conjunction with many of the Database Engine features found in SQL Server 2012. For example, database administrators can implement a columnstore index on a table and still successfully use AlwaysOn Availability Groups (AG), AlwaysOn failover cluster instances (FCI),