批量更新数据库表.sql 244 B

1234567891011
  1. BEGIN
  2. declare @i int
  3. set @i= (select COUNT(id) from dbo.tb_ErpCustomer)
  4. while @i>0
  5. begin
  6. UPDATE [dbo].[tb_ErpCustomer] SET [Cus_Birthday] = CONVERT(varchar(100), CONVERT(datetime, Replace([Cus_Birthday],'A','')), 20)
  7. set @i=@i-1
  8. end
  9. END