Database Tutorials

How to modify the null options on a column in SQL server

Developers can specify whether to allow or disallow null values, for each column in their table. A null value, or NULL, is not the same as zero (0) or blank; NULL means that no entry has been made. Its presence usually implies that the value is either unknown or undefined. If null values are not allowed, …

Learn more

How to modify the identity properties for a column in SQL server

Developers can change the identity properties of a column if they want to redefine the sequential numbers that are automatically generated and stored in that column when new records are added to the table. They can set the identity properties on only one column per table. Columns that have the identity property contain system-generated sequential values …

Learn more

How to delete a foreign key constraint from GUI in SQL server

Developers delete a foreign key constraint when they want to remove the requirement to enforce referential integrity. To remove a foreign key they should follow the next steps:

1. In Object Explorer, right-click the table with the constraint, and click Design (Modify in SP1 or earlier).

The table opens in …

Learn more

How to modify the scale of a columns data type in SQL server

The column scale refers to the maximum number of digits to the right of the decimal point for those columns of the decimal or numeric data types. By default, it is set to 0. For columns with floating point numbers, the scale is undefined because the number of digits to the right of the decimal point …

Learn more

How to draw a reflexive relationship in SQL server

Developers create a reflexive relationship to link a column or columns in a table with another column or columns in the same table. For example, suppose the employee table has an emp_id column and a mgr_id column. Because each manager is also an employee, developers can relate these two columns by drawing a relationship line from …

Learn more

How to create a many-to-many relationship between tables in SQL server

Many-to-many relationships let developers relate each row in one table to many rows in another table, and vice versa. For example, they could create a many-to-many relationship between the singers table and the songs table to match each singer to all of his or her songs and to match each song to all of its singers. …

Learn more

How to set column collation in SQL server

Developers set column collation when the users of their instance of SQL server speak multiple languages. In this keys developers should pick a collation that best supports the requirements of the various languages.When developers working with SQL Server “Denali”, MS SQL Server 2008 R2 and MS SQL Server 2005 want to set column collation, they should …

Learn more