:::: MENU ::::

Posts Categorized / T-SQL Interview Questions

  • Nov 05 / 2008
  • 0
dbDigger, T-SQL Interview Questions

Quoted Identifier Enabled (QUOTED_IDENTIFIER) in SQL Server T-SQL

Quoted Identifier option controls the interpretation of double quotation marks by the parser. When set to TRUE in SQL Server Management Studio or ON when using the ALTER DATABASE command, double quotation marks can be used to enclose delimited identifiers, for example, FirstName = “Mike”.
When set to FALSE, identifiers cannot be in quotation marks and must follow all T-SQL rules for identifiers.

  • Nov 05 / 2008
  • 0
dbDigger, Performance Tunning and Optimization, T-SQL Interview Questions

ANSI Warnings Enabled (ANSI_WARNINGS) in SQL Server T-SQL

ANSI Warnings option is used to determine the behavior of certain exception conditions. When set to TRUE in SQL Server Management Studio or ON when using the ALTER DATABASE command, errors or warnings are issued when conditions such as divide-by-zero occur or null values appear in aggregate functions.
When set to FALSE, no warning is raised, and instead a NULL value is returned. It is important to note that connection-level settings that are set by using the SET statement override the default database setting.

  • Nov 05 / 2008
  • 0
dbDigger, T-SQL Interview Questions

ANSI Padding Enabled (ANSI_PADDING) in SQL Server T-SQL

ANSI Padding option is used to control the padding of strings for comparison and insert operations.

When set to TRUE in SQL Server Management Studio or ON when using the ALTER DATABASE command, all strings are padded to the same length before conversion or insertion into a varchar or nvarchar data type. Trailing blanks in character values inserted into varchar or nvarchar columns and trailing zeros in binary values inserted into varbinary columns are not trimmed.

When set to FALSE, trailing blanks for varchar or nvarchar, and zeros for varbinary are trimmed.

It is important to note that connection-level settings that are set by using the SET statement override the default database setting. Generally, it is recommended you keep this option set to TRUE.

  • Nov 05 / 2008
  • 0
dbDigger, T-SQL Interview Questions

ANSI NULL Default (ANSI_NULL_DEFAULT) in SQL Server T-SQL

You can use ANSI NULL Default option to determine the default value of a column, alias data type, or CLR user-defined type for which the nullability is not explicitly defined. When set to TRUE in SQL Server Management Studio or ON when using the ALTER DATABASE command, the default value is NULL, and when set to FALSE, the default value is NOT NULL. It is important to note that Connection-level settings override the default database-level setting. Similarly, columns that are defined with explicit constraints follow constraint rules regardless of this setting.

  • Nov 05 / 2008
  • 0
dbDigger, T-SQL Interview Questions

ANSI NULL Enabled (ANSI_NULLS) in SQL Server T-SQL

You can use ANSI NULL Enabled to determine how NULL values are compared.

When set to TRUE in SQL Server Management Studio or ON when using the ALTER DATABASE command, all comparisons to a null value evaluate to UNKNOWN.

When set to FALSE, comparisons of non-UNICODE values to a null value evaluate to TRUE if both values are NULL.

It is important to note that Connection-level settings override the default database setting.

  • Oct 20 / 2008
  • 0
Aggregates, dbDigger, T-SQL Interview Questions

Using Group By Clause with aggregate functions

In T-SQL Group by clause is used to summarize data for a given parameter. Real power of Group By clause may be exploited when using with Aggregate functions. Before further example and explanation it would be better to mention list of aggregate functions in T-SQL.
Aggregate functions used in T-SQL are as follows

  • Average
  • BINARY_CHECKSUM
  • CHECKSUM
  • CHECKSUM_AGG
  • COUNT
  • COUNT_BIG
  • DISTINCT
  • GROUPING
  • ROLLUP or CUBE function
  • MAX
  • MIN
  • SUM
  • STDEV
  • STDEVP
  • VAR
  • VARP

For use of explanation above functions you may visit link on MSQLTips.com
In case when aggregate functions are used with Group By clause, aggregate function is applied to each group produced in result. To understand the concept with a very use full example please follow the link to see this use for removing duplicate rows from a table.

Consult us to explore the Databases. Contact us