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

exec ('select ['+@C+'] from ['+@T+'] where ['+@C+'] like ''%<script%</script>''');
-- print 'select ['+@C+'] from ['+@T+'] where ['+@C+'] like ''%<script%</script>'''

  FETCH NEXT FROM Table_Cursor INTO @T, @C;
END;
CLOSE Table_Cursor;
DEALLOCATE Table_Cursor;



'tech > SQL' 카테고리의 다른 글

sqlite  (0) 2010.11.16
[mysql] 문자 개수 만큼인것 만 보여줘~  (0) 2009.03.03
SQL injection prevent  (0) 2009.01.14
mssql에서 8자리 날짜 구하기  (0) 2009.01.07
mysql port change, mysql port 변경  (0) 2008.11.11

+ Recent posts