In my customer table not all the customer IDs are in sequence. Is there any way within SQL I can fill the gaps not necessarily by updating the table; instead, being able to export the data to a CSV file.The records that are filled dynamically by the SQL statement, I would like to be able to add some dummy text to the customer name. So, when I use Excel to edit the CSV file, I can easily identity which records where filled by the SQL statement.Here is the structure of the table in case you want to review:USE [implantdirect]GO/****** Object: Table [dbo].[Customers] Script Date: 05/07/2012 16:42:49 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOSET ANSI_PADDING ONGOCREATE TABLE [dbo].[Customers]( [CustomerID] [int] IDENTITY(1,1) NOT NULL, [AccessKey] [varchar](1) NULL, [Password] [varchar](64) NULL, [FirstName] [varchar](30) NULL, [LastName] [varchar](40) NULL, [CompanyName] [varchar](100) NULL, [BillingAddress1] [varchar](75) NULL, [BillingAddress2] [varchar](75) NULL, [City] [varchar](45) NULL, [State] [varchar](30) NULL, [PostalCode] [varchar](15) NULL, [Country] [varchar](30) NULL, [PhoneNumber] [varchar](35) NULL, [FaxNumber] [varchar](30) NULL, [EmailAddress] [varchar](75) NULL, [PaysStateTax] [varchar](3) NULL, [TaxID] [varchar](64) NULL, [EmailSubscriber] [varchar](1) NULL, [CatalogSubscriber] [varchar](1) NULL, [LastLogin] [smalldatetime] NULL, [LastModified] [smalldatetime] NULL, [PercentDiscount] [float] NULL, [WebsiteAddress] [varchar](150) NULL, [DiscountLevel] [varchar](1) NULL, [FirstDateVisited] [smalldatetime] NULL, [FirstOrderDate] [smalldatetime] NULL, [CustomerType] [varchar](1) NULL, [LoginAttempts] [int] NULL, [LastLoginAttempt] [smalldatetime] NULL, [LastModBy] [int] NULL, [Customer_IsAnonymous] [varchar](1) NULL, [IsSuperAdmin] [varchar](1) NULL, [news1] [varchar](1) NULL, [news2] [varchar](1) NULL, [news3] [varchar](1) NULL, [news4] [varchar](1) NULL, [news5] [varchar](1) NULL, [news6] [varchar](1) NULL, [news7] [varchar](1) NULL, [news8] [varchar](1) NULL, [news9] [varchar](1) NULL, [news10] [varchar](1) NULL, [news11] [varchar](1) NULL, [news12] [varchar](1) NULL, [news13] [varchar](1) NULL, [news14] [varchar](1) NULL, [news15] [varchar](1) NULL, [news16] [varchar](1) NULL, [news17] [varchar](1) NULL, [news18] [varchar](1) NULL, [news19] [varchar](1) NULL, [news20] [varchar](1) NULL, [Allow_Access_To_Private_Sections] [varchar](1) NULL, [Checkbox_For_New_Customers] [varchar](1) NULL, [Customer_Notes] [text] NULL, [SalesRep_CustomerID] [int] NULL, [ID_Customers_Groups] [int] NULL, [Custom_Field_Custom1] [varchar](50) NULL, [Custom_Field_Custom2] [varchar](50) NULL, [Custom_Field_Custom3] [varchar](50) NULL, [Custom_Field_Custom4] [varchar](50) NULL, [Custom_Field_Custom5] [varchar](50) NULL, [Custom_Field_Custom7] [varchar](50) NULL, [Custom_Field_Experience] [varchar](50) NULL, [Custom_Field_test] [varchar](10) NULL, [Custom_Field_License] [varchar](30) NULL, [Custom_Field_Custom8] [varchar](255) NULL, [Custom_Field_Custom9] [varchar](255) NULL, [Custom_Field_Custom10] [varchar](255) NULL, [Custom_Field_ACK] [varchar](50) NULL, CONSTRAINT [PK_Customers] PRIMARY KEY CLUSTERED ( [CustomerID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]GOSET ANSI_PADDING OFFGO
Thank you,--Fawad RashidiWeb Developerwww.fawadafr.com