Jayce Ooi’s Paradise

Photography, programming, technology, finance, anything =)
Subscribe to Jayce Ooi's Paradise feeds

CREATE INDEX (Transact-SQL)

CREATE INDEX, why do we need to create index at SQL table? By create index in table will help to locate rows more quickly and efficiently. You can create UNIQUE, CLUSTERED and NONCLUSTERED index.

For example,

CREATE INDEX index_name ON table_name (column_name)

Above is the simple way to create an index into a table. By default, NONCLUSTERED INDEX is created. So what does UNIQUE, CLUSTERED and NONCLUSTERED index mean?

UNIQUE
Creates a unique index on a table or view. A unique index is one in which no two rows are permitted to have the same index key value. A clustered index on a view must be unique.

CLUSTERED
Creates an index in which the logical order of the key values determines the physical order of the corresponding rows in a table.

NONCLUSTERED

Creates an index that specifies the logical ordering of a table. With a nonclustered index, the physical order of the data rows is independent of their indexed order.

How to change GridView HeaderText?

How to change GridView HeaderText? I have been looking for this solution for days. Finally, I got the answer. Yeah… ;)
Here is the code…

GridView01.Columns[0].HeaderText = “HeaderName”;

This will change the GridView’s first column to “HeaderName”.

ISNUMERIC (Transact-SQL)

What is ISNUMERIC in Transact-SQL? It is used to determine that the value is numeric or not. It will return ‘1′ when the value is numeric. Else it will return ‘0′.

Example,

DECLARE @temp nvarchar(100);
SELECT @temp = ‘100′;
SELECT ISNUMERIC(@temp);

The returned result is ‘1′.

Table (NOLOCK) (Transact-SQL)

What does Table (NOLOCK) in Transact-SQL mean? NOLOCK is equivalent to READUNCOMMITTED. It is mean that dirty reads are allowed. No shared locks are issued to prevent other transactions from modifying data read by the current transaction, and exclusive locks set by other transactions do not block the current transaction from reading the locked data.

See SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED / READ COMMITTED / REPEATABLE READ / SNAPSHOT / SERIALIZABLE (Transact-SQL) too.

REPLACE (Transact-SQL)

What is REPLACE in Transact-SQL? It will replace all occurrences of a specified string value with another string value.

The REPLACE syntax

REPLACE (searchedString, foundString, replacedString)

Example,

SELECT REPLACE(’abcdefghicde’,'cde’,'xxx’);
GO

The returned result is “abxxxfghixxx”. Basically, it replaced all the ‘cde’ with ‘xxx’.

« Older Entries  Newer Entries »

Page 2 of 10«12345»...Last »

Sponsored links

Archives

Chat Chat Chat...





Isabell Online Penang Florist

Isabell Online Penang florist

Recent Comments

Top Commentators