Currently browsing tag

Table

Copying Table with INDEX and CONSTRAINTS

Copying Table with INDEX and CONSTRAINTS Introduction When we are trying to copy a table (Structure only or with Data) we are unable to copy the Indexes, constraint with it. Can we copy Indexes and Constraint with Table structure in the same database? This article is related to it. General …

Dynamic SQL result stored in a TABLE

Dynamic SQL result stored in a TABLE Introduction As we all know that the dynamic SQL is not good where performance is concern. But sometimes we don’t have other choices. As I personally think that, no developer chooses the dynamic SQL with interest, but they choose it as they have …

Table Variable with Dynamic SQL

Table Variable with Dynamic SQL Introductions The table variable gives us the high degree of flexibility to work with T-SQL construct. Most of the developer uses the table variable to find the desired solutions due to its simplicities. Here in this article I am not discussing related to table variable. …

Partition Table

Partition Table The Table partitioning can make very large tables and index easier to manage and improve the performance of the query. This article is related to table partitioning concept and how you crate the partition table. Hope all of my readers will like it. History Table partitioning was introduced …

How to Remove duplicate entry from a Table

How to Remove duplicate entry from a Table It’s a quite simple SQL manipulation for dulplicate entry delitions. Some how I am noted it down for a quick references. — Step-1 [ Create a Table ] CREATE TABLE AA             (x DECIMAL,              y VARCHAR) — Step-2 [ Insert Some …

Reclaiming Table Space

Reclaiming Table Space SQL Server will reuse space made available when rows are deleted from a table. This occurs automatically without any outside intervention on our part. However under certain circumstances, SQL Server does not automatically reclaim space once used. If a table definition is altered to drop one or …

Data Structure Hashing and Hash Table Generation using CC

Data Structure – Hashing and Hash Table Generation using C/C++ Hashing is the transformation of a string of characters into a usually shorter fixed-length value or key that represents the original string. Hash Function A function that transforms a key into a table index is called a hash function. If …

No more temporary Table Use CTE

No more temporary Table Use CTE Avoid using temporary tables and derived tables as it uses more disks I/O. Instead use CTE (Common Table Expression); its scope is limited to the next statement in SQL query. The following example shows the components of the CTE structure: expression name, column list, …

SQL Table Constraints

SQL Table Constraints   Some of my readers mailed me that, “Why you write simple article in your web. As you your web contains very good stuff… but some tropics are really simple.” It is facts. I have long list of friends from Linked In web. They send me regular …

Global Vs Local Temporary Table

Global Vs Local Temporary Table   Temporary table is a very important part for SQL developer. Here in this article we are focusing about the local and global temporary table. A global temporary table is visible to any session while in existence. It lasts until all users that are referencing …

Comparing Two Image fields in a Table Objects

Comparing Two Image fields in a Table Objects   In this article my main objective is to compare 2 image fields (old image and new image) of a table objects. For this I use extended stored procedure ex_md5 from master database. I provide the complete set of scenario for this …

How to Remove duplicate entry from a Table

How to Remove duplicate entry from a Table It’s a quite simple SQL manipulation for dulplicate entry delitions. Some how I am noted it down for a quick references.   — Step-1 [ Create a Table ]   CREATE TABLE AA             (x DECIMAL,              y VARCHAR)   — Step-2 …