Home Forums SQL Server 7,2000 T-SQL Wholsesale conversion of char to varchar? RE: Wholsesale conversion of char to varchar?

  • I once wrote scripts to do this.

    At the moment I can only find the trim script:

    
    
    select 'update ' + o.name + ' set ' + c.name + '=RTRIM(' + c.name + ')'
    from syscolumns c, sysobjects o
    where o.id=c.id
    and c.xtype=167
    and o.type='U'
    order by o.name,c.name

    This generates the script that does the real work. The alter table script can be generated in a similar way.