Hi, i currently have to function in vb.net.One will call a datareader to loop through the columns find with this query:select column_namefrom INFORMATION_SCHEMA.COLUMNSwhere table_name = @tablename
and for each datareader row it will run Update zztesttrim set columname = ltrim(rtrim(columname))
I was wondering if there is a method to automate. I was looking at some code Tara gave me for mergin tables rows in on big table but i am not sure it it will work here.if it can help the code for that is:declare @dsql nvarchar(4000), @id int, @rc intset @id = 1declare @temp1 table (Customer_name nvarchar(1000), customer_province nvarchar(1000))declare @DBTempSyncScenario table (TempTableNamev sysname)INSERT INTO @DBTempSyncScenarioSELECT TempTableName FROM DBTempSyncScenario where firstrown =1select identity(int, 1, 1) as TempTableId, 'select Customer_name, customer_province from ' + TempTableNamev as TempTableQueryinto #temp2from @DBTempSyncScenarioset @rc = @@rowcountwhile @id <= @rcbegin select @dsql = TempTableQuery from #temp2 where TempTableId = @id insert into @temp1 exec (@dsql) set @id = @id + 1endselect Customer_name, customer_provincefrom @temp1--drop table @DBTempSyncScenario--drop table @temp1drop table #temp2