--SELECT 'Truncate table '+TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' order by TABLE_NAME Truncate table Arikada_Import Truncate table Bnk_DailyStmnt Truncate table Bonus Truncate table Branch Truncate table C_Agent Truncate table C_Auction_Draw Truncate table C_Customer Truncate table C_DailyCollection Truncate table C_ImportDaily Truncate table C_KMWS Truncate table C_KVVES Truncate table C_Master Truncate table C_Rcpt Truncate table C_Rcpt_Details Truncate table C_Reg Truncate table C_setDivident --Truncate table Charity_Pymnt --Truncate table Charity_Receipt --Truncate table Charity_Reg --Truncate table Charity_Types --Truncate table Color Truncate table Commission Truncate table Committee Truncate table CommitteeMAdd Truncate table Course Truncate table DailyStmnt Truncate table DailyStmnt_Payment Truncate table DailyStmnt_Receipt Truncate table Damage Truncate table DamageDetails Truncate table Denomination_DailyStmnt Truncate table Division Truncate table DriverDetails Truncate table Dummy Truncate table DummyDetails --Truncate table Employee_FlowerMake Truncate table Employee_Payroll --Truncate table EntryPass Truncate table Estimation Truncate table EstimationDetails Truncate table G_Ornaments Truncate table GL_Ornaments Truncate table GL_Receipt Truncate table GoldLoan Truncate table H_Head Truncate table H_Rcpt Truncate table H_Rcpt_Details Truncate table H_RegClient Truncate table H_RRcpt Truncate table H_set_Room Truncate table H_set_RoomNo Truncate table Hptl_Dctr Truncate table Hptl_DctrSchedule Truncate table Hptl_Dprmnt Truncate table Hptl_L_TestName Truncate table Hptl_Lab_TestBill Truncate table Hptl_Lab_TestRprt Truncate table Hptl_LabrtryDprmnt Truncate table Hptl_OP_Reg --Truncate table INSU_Pymnt --Truncate table INSU_Receipt --Truncate table INSU_Reg Truncate table IntrstAmt Truncate table Inventory Truncate table Item_Medical --Truncate table JobCard --Truncate table JobCard_Details Truncate table L_Loan Truncate table L_Receipt Truncate table L_SuretyDetails Truncate table L_Type Truncate table L_TypesOfLoan Truncate table M_Distrbn Truncate table M_Item Truncate table M_MF_Destn Truncate table M_MF_Source Truncate table M_Return Truncate table M_SubItem --Truncate table Machine Truncate table Medium Truncate table MF_Destination Truncate table MF_Pymnt Truncate table MF_Receipt Truncate table MF_Reg Truncate table mf_source Truncate table MF_Types Truncate table MsgSend Truncate table MsgSendTo --Truncate table NP_Pymnt --Truncate table NP_Receipt --Truncate table NP_Reg --Truncate table NP_Types Truncate table OpeningBalance Truncate table OpeningStock --Truncate table Payment_Zain Truncate table Payroll Truncate table Posthumous Truncate table Posthumous_Rcpt Truncate table Product Truncate table product_price_history Truncate table Pur_Adv Truncate table Pur_Return Truncate table Pur_Return_Details Truncate table Purchase Truncate table PurchaseDetails Truncate table PurchaseOrder Truncate table PurchaseOrderDetails Truncate table Quotation Truncate table QuotationDetails Truncate table R_Brand Truncate table R_Category Truncate table R_Item Truncate table R_Sales Truncate table R_SDetails Truncate table R_TableNo Truncate table R_Waiter Truncate table Registration Truncate table Reservation Truncate table S_Center Truncate table S_Item Truncate table S_Registration Truncate table S_ServicesTo Truncate table S_SubReg Truncate table Sales Truncate table SalesDetails Truncate table SalesOrder Truncate table SalesOrderDetails Truncate table SalesReturn Truncate table SalesReturn_Details Truncate table SB_Transaction Truncate table SBFD_Deposit Truncate table SBFD_Reg Truncate table SBFD_Withdarw Truncate table SchoolStaff Truncate table St_Category Truncate table St_Course Truncate table St_Recepit Truncate table St_Reg Truncate table Staff_Att_Reg Truncate table Stock_Trfr_From Truncate table Stock_Trfr_From_Details Truncate table Stock_Trfr_To Truncate table Stock_Trfr_To_Details Truncate table StockTransfer Truncate table Student_AcHead Truncate table Student_Rcpt Truncate table Student_Reg Truncate table TableImage Truncate table Tc Truncate table TeleMrkt_Reg Truncate table UserLogin Truncate table v_Contra Truncate table v_CreditNote Truncate table v_DebitNote Truncate table v_DebitNoteDetails Truncate table v_Journal Truncate table v_Payment Truncate table v_Purchase Truncate table v_PurDetails Truncate table v_Receipt Truncate table v_Sales Truncate table v_SalesDetails Truncate table Vehicle Truncate table Vehicle_Run Truncate table Vehicle_Service Truncate table Web_Bank_Deposit Truncate table Web_Bank_Withdraw Truncate table Web_Payment Truncate table Web_Receipt Truncate table Z_EV_Purchase Truncate table Z_EV_PurchaseDetails Truncate table Z_EV_Sales Truncate table Z_EV_SalesDetails --Select * from dbo.sysfiles ---- Is used to Shrink the File ::::: --ALTER DATABASE infinesolutions SET RECOVERY SIMPLE WITH NO_WAIT --DBCC SHRINKFILE(ERP_Log,1) -- 1 MEANS : 1 MB --;WITH Ranked --AS --( -- SELECT *, ROW_NUMBER() OVER(ORDER BY itemid) row_num -- FROM item --) --UPDATE Ranked --SET ItemCode = row_num;