![]() Now, let us create a table named tblPatient with NOT NULL constraint. A foreign key constraint prevents the UPDATE and DELETE statement that breaks the link between two tables. A table can have one or more foreign keys. The foreign key of any table refers to the Primary Key of another table. FOREIGN KEY: The foreign key is a column that creates a link between two tables.When we create a primary key, a clustered index will be created automatically. In SQL, We can search for a specific column name in a table by using the SELECT statement and specifying the column name after the SELECT keyword. We can create one primary key in a table. ![]() The primary key contains unique values and cannot contain a NULL value. 4 Answers Sorted by: 6 You can always inspect the sys.columns catalog view: SELECT c.NAME 'Col Name', OBJECTNAME (c.OBJECTID) 'Table Name', t.name FROM sys.columns c INNER JOIN sys.types t ON c.systemtypeid t.systemtypeid WHERE c. The primary key consists of one or more columns. Following are the characteristics of the Primary key
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |