sql server programming:
i have a table named sauda which contains more than 52 lacs of record
the structure of the table is shown below
if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[SAUDA]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[SAUDA]
GO
CREATE TABLE [dbo].[SAUDA] (
[TRANSACTIONNO] [int] IDENTITY (1, 1) NOT NULL ,
[TRANDATE] [datetime] NOT NULL ,
[PRODUCT] [char] (10) NOT NULL ,
[GROUPCODE] [char] (2) NOT NULL ,
[STTLYEAR] [int] NOT NULL ,
[STTLNO] [int] NOT NULL ,
[CLIENTID] [int] NOT NULL ,
[SECURITY] [char] (10) NOT NULL ,
[BUYSELL] [char] (1) NOT NULL ,
[QTY] [int] NOT NULL ,
[RATE] [numeric](15, 2) NOT NULL ,
[TRADENO] [varchar] (25) NULL ,
[TRADETIME] [varchar] (25) NULL ,
[ORDERNO] [varchar] (25) NULL ,
[BRANCHID] [varchar] (10) NULL ,
[TERMINALID] [varchar] (10) NULL ,
[SLABID] [int] NULL ,
[BROKERAGE] [numeric](15, 2) NULL ,
[BrokerageCharged] [numeric](18, 4) NOT NULL ,
[SERVICETAX] [numeric](15, 2) NULL ,
[TOLEVY] [numeric](15, 2) NULL ,
[ToTax] [numeric](18, 2) NOT NULL ,
[TrnCharges] [numeric](18, 2) NOT NULL ,
[TgFund] [numeric](18, 2) NOT NULL ,
[TCFund] [numeric](18, 2) NOT NULL ,
[RegFee] [numeric](18, 2) NOT NULL ,
[StampDuty] [numeric](18, 2) NOT NULL ,
[ACCOUNTDATE] [datetime] NULL ,
[CONTRACTNOTENO] [varchar] (25) NULL ,
[BILLNO] [char] (10) NULL ,
[MODIFYCOUNT] [smallint] NULL ,
[SAUDATYPE] [varchar] (10) NULL ,
[Location] [char] (4) NOT NULL ,
[InstrumentType] [char] (3) NULL ,
[BookType] [char] (3) NULL ,
[MarketType] [char] (3) NULL ,
[SignedQty] [int] NULL ,
[OrderType] [varchar] (4) NULL ,
[Funding] [char] (1) NULL ,
[DELSERVICE] [numeric](15, 2) NULL ,
[DelServiceCharged] [numeric](18, 4) NOT NULL ,
[DELSERVICEQTY] [int] NULL ,
[DelServiceTax] [numeric](18, 3) NULL ,
[LASTUPDATEDON] [datetime] NULL ,
[euser] [char] (8) NULL ,
[clientcodetype] [char] (1) NULL ,
[Clientcategory] [char] (2) NULL ,
[slNo] [int] NULL ,
[tradedcode] [char] (10) NULL ,
[DLVflag] [char] (10) NULL ,
[MANUALENTRY] [char] (10) NULL ,
[DlvServiceChargePerQty] [numeric](15, 2) NOT NULL ,
[NDDate] [datetime] NULL ,
[GadvanceBrokeragePercent] [numeric](15, 3) NOT NULL ,
[GadvanceBrokerage] [numeric](15, 3) NOT NULL ,
[GadvanceBrokerageServiceTax] [numeric](15, 3) NOT NULL ,
[Channel] [varchar] (10) NULL ,
[sharedBrokerage] [numeric](15, 2) NOT NULL ,
[sharedBrokeragePer] [numeric](15, 2) NOT NULL ,
[EducationalCessSTax] [numeric](15, 2) NULL ,
[TurnoverTax] [numeric](15, 2) NULL ,
[EducationalCessToTax] [numeric](15, 2) NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SAUDA] WITH NOCHECK ADD
CONSTRAINT [DF_SAUDA_BUYSELL] DEFAULT ('B') FOR [BUYSELL],
CONSTRAINT [DF_SAUDA_BROKERAGE] DEFAULT (0) FOR [BROKERAGE],
CONSTRAINT [DF_SAUDA_BrokerageCharged] DEFAULT (0) FOR [BrokerageCharged],
CONSTRAINT [DF_SAUDA_SERVICETAX] DEFAULT (0) FOR [SERVICETAX],
CONSTRAINT [DF_SAUDA_TOLEVY] DEFAULT (0) FOR [TOLEVY],
CONSTRAINT [DF_SAUDA_ToTax] DEFAULT (0.000) FOR [ToTax],
CONSTRAINT [DF_SAUDA_ToTax1] DEFAULT (0.000) FOR [TrnCharges],
CONSTRAINT [DF_SAUDA_ToTax2] DEFAULT (0.000) FOR [TgFund],
CONSTRAINT [DF_SAUDA_ToTax3] DEFAULT (0.000) FOR [TCFund],
CONSTRAINT [DF_SAUDA_ToTax4] DEFAULT (0.000) FOR [RegFee],
CONSTRAINT [DF_SAUDA_ToTax5] DEFAULT (0.000) FOR [StampDuty],
CONSTRAINT [DF_SAUDA_MODIFYCOUNT] DEFAULT (0) FOR [MODIFYCOUNT],
CONSTRAINT [DF_SAUDA_InstrumentType] DEFAULT (0) FOR [InstrumentType],
CONSTRAINT [DF_SAUDA_BookType] DEFAULT (0) FOR [BookType],
CONSTRAINT [DF_SAUDA_MarketType] DEFAULT (0) FOR [MarketType],
CONSTRAINT [DF_SAUDA_SignedQty] DEFAULT (0) FOR [SignedQty],
CONSTRAINT [DF_SAUDA_Funding] DEFAULT ('N') FOR [Funding],
CONSTRAINT [DF_SAUDA_DELSERVICE] DEFAULT (0) FOR [DELSERVICE],
CONSTRAINT [DF_SAUDA_DelServiceCharged] DEFAULT (0) FOR [DelServiceCharged],
CONSTRAINT [DF_SAUDA_DelServiceTax] DEFAULT (0) FOR [DelServiceTax],
CONSTRAINT [DF_SAUDA_LASTUPDATEDON] DEFAULT (getdate()) FOR [LASTUPDATEDON],
CONSTRAINT [DF_SAUDA_clientcodetype] DEFAULT ('N') FOR [clientcodetype],
CONSTRAINT [DF_SAUDA_Clientcategory] DEFAULT ('CL') FOR [Clientcategory],
CONSTRAINT [DF_SAUDA_slNo] DEFAULT (1) FOR [slNo],
CONSTRAINT [DF_SAUDA_DLVflag] DEFAULT ('Y') FOR [DLVflag],
CONSTRAINT [DF__Sauda__DlvServic__7FA1AFD2] DEFAULT (0) FOR
[DlvServiceChargePerQty],
CONSTRAINT [DF__sauda__GadvanceB__6D0DFE4B] DEFAULT (0) FOR
[GadvanceBrokeragePercent],
CONSTRAINT [DF__sauda__GadvanceB__6E022284] DEFAULT (0) FOR
[GadvanceBrokerage],
CONSTRAINT [DF__sauda__GadvanceB__6EF646BD] DEFAULT (0) FOR
[GadvanceBrokerageServiceTax],
CONSTRAINT [DF__sauda__sharedBro__0C5C8C72] DEFAULT (0.00) FOR
[sharedBrokerage],
CONSTRAINT [DF__sauda__sharedBro__0D50B0AB] DEFAULT (0.00) FOR
[sharedBrokeragePer],
CONSTRAINT [PK_SAUDA] PRIMARY KEY NONCLUSTERED
(
[TRANSACTIONNO]
) ON [PRIMARY]
GO
/****** The index created by the following statement is for internal use
only. ******/
/****** It is not a real index but exists as statistics only. ******/
if (@@microsoftversion > 0x07000000 )
EXEC ('CREATE STATISTICS [hind_271_6] ON [dbo].[SAUDA] ([STTLNO]) ')
GO
/****** The index created by the following statement is for internal use
only. ******/
/****** It is not a real index but exists as statistics only. ******/
if (@@microsoftversion > 0x07000000 )
EXEC ('CREATE STATISTICS [hind_260_3] ON [dbo].[SAUDA] ([PRODUCT]) ')
GO
/****** The index created by the following statement is for internal use
only. ******/
/****** It is not a real index but exists as statistics only. ******/
if (@@microsoftversion > 0x07000000 )
EXEC ('CREATE STATISTICS [hind_260_16] ON [dbo].[SAUDA] ([TERMINALID]) ')
GO
/****** The index created by the following statement is for internal use
only. ******/
/****** It is not a real index but exists as statistics only. ******/
if (@@microsoftversion > 0x07000000 )
EXEC ('CREATE STATISTICS [hind_260_46] ON [dbo].[SAUDA] ([clientcodetype]) ')
GO
/****** The index created by the following statement is for internal use
only. ******/
/****** It is not a real index but exists as statistics only. ******/
if (@@microsoftversion > 0x07000000 )
EXEC ('CREATE STATISTICS [hind_260_33] ON [dbo].[SAUDA] ([Location]) ')
GO
/****** The index created by the following statement is for internal use
only. ******/
/****** It is not a real index but exists as statistics only. ******/
if (@@microsoftversion > 0x07000000 )
EXEC ('CREATE STATISTICS [hind_260_8] ON [dbo].[SAUDA] ([SECURITY]) ')
GO
/****** The index created by the following statement is for internal use
only. ******/
/****** It is not a real index but exists as statistics only. ******/
if (@@microsoftversion > 0x07000000 )
EXEC ('CREATE STATISTICS [hind_260_7] ON [dbo].[SAUDA] ([CLIENTID]) ')
GO