June 13, 2009
Sql Server - Generate Auto number in Select Query
SELECT ROW_NUMBER() OVER (ORDER BY ColumnName ASC) AS ROWID, * FROM Tablename
SQL Server - constraint
A constraint is assigned to a column or the set of columns in a table that prevents certain types of inconsistent data values from being placed in the column(s).
Constraints are used to enforce the data integrity.
This ensures the accuracy and reliability of the data in the database. The following categories of the data integrity exist:
• Entity Integrity
ensures that there are no duplicate rows in a table.
• Domain Integrity
enforces valid entries for a given column by restricting the type, the
format, or the range of possible values.
• A product name cannot be NULL.
• A product name must be unique.
• The date of an order must not be in the future.
• The product quantity in an order must be greater than zero.
• Referential integrity
ensures the relationships between tables remain preserved as data is inserted, deleted, and modified.
enforces some specific business rules that do not fall into entity, domain, or referential integrity categories.
Microsoft SQL Server supports the following constraints:
• PRIMARY KEY
• UNIQUE
• FOREIGN KEY
• CHECK
• NOT NULL
Constraints are used to enforce the data integrity.
This ensures the accuracy and reliability of the data in the database. The following categories of the data integrity exist:
• Entity Integrity
ensures that there are no duplicate rows in a table.
It specifying a PRIMARY KEY constraint.Example: the ProductID column of the Products table is a primary key for the table.
• Domain Integrity
enforces valid entries for a given column by restricting the type, the
format, or the range of possible values.
It specifying a CHECK constraints, UNIQUE constraints, and DEFAULT constraints.The following list gives a sampling of domain integrity constraints.
• A product name cannot be NULL.
• A product name must be unique.
• The date of an order must not be in the future.
• The product quantity in an order must be greater than zero.
• Referential integrity
ensures the relationships between tables remain preserved as data is inserted, deleted, and modified.
It specifying a FOREIGN KEY constraint.• User-Defined Integrity
enforces some specific business rules that do not fall into entity, domain, or referential integrity categories.
Microsoft SQL Server supports the following constraints:
• PRIMARY KEY
• UNIQUE
• FOREIGN KEY
• CHECK
• NOT NULL
June 5, 2009
Vb.Net - Get system IP Address and Name
Dim LocalHostName As String
LocalHostName = GetHostName()
Dim ipEnter As IPHostEntry = GetHostByName(LocalHostName)
Dim IpAdd() As IPAddress = ipEnter.AddressList
strSystemIP = IpAdd(0).ToString()
LocalHostName = GetHostName()
Dim ipEnter As IPHostEntry = GetHostByName(LocalHostName)
Dim IpAdd() As IPAddress = ipEnter.AddressList
strSystemIP = IpAdd(0).ToString()
Subscribe to:
Posts (Atom)