Well it's probably good it doesn't work.This kind of thing can really mess stuff up.I mean, I would you the catalog to generate the scripts...save them in a *.sql file, Restore a database to another database, test the script there, nake sure it all works ok, the execute the script using osql from a bat file...It seems like you're not sure where the stuff is you want to change.I would identify those problem situation first and localize my changes..Set NOCOUNT ONDeclare @Table Table( Tablename varchar(20) not null)Insert @Table values( 'Orders' )Declare @TableName sysname, @ColName sysname, @ColOrder int, @Query1 varchar(5000), @Query2 varchar(5000), @Query3 varchar(5000)declare cc cursorFOR SELECT c.COLUMN_NAME, c.TABLE_NAME FROM INFORMATION_SCHEMA.Columns c INNER JOIN INFORMATION_SCHEMA.Tables t ON c.TABLE_NAME = t.TABLE_NAME WHERE TABLE_TYPE = 'BASE TABLE' AND EXISTS (SELECT * FROM @table i WHERE t.TABLE_NAME = i.TableName) ORDER BY c.TABLE_NAME, c.ORDINAL_POSITIONOpen ccFetch Next From cc Into @ColName, @tablenameWhile @@FETCH_STATUS = 0 BEGIN select @Query1 = 'UPDATE ' + @TableName + ' SET ' + @ColName + ' = NULL WHERE ' + @ColName + ' = ''.''' SELECT @query1 select @Query2 = 'UPDATE ' + @TableName + ' SET ' + @ColName + ' = NULL WHERE LTRIM(RTRIM(' + @ColName + ')) = ''''' SELECT @query2 select @Query3 = 'ALTER TABLE ' + @TableName + ' ALTER COLUMN ' + @ColName + ' varchar(50)' SELECT @query3 Fetch Next From cc Into @ColName, @tablename ENDCLOSE ccDEALLOCATE ccGOOh, btw, @tablename was never set so it was always nullBrett8-)