LSX-blog

Feed Rss

【原创】遍历数据库字段

11.28.2011, MSSQL, by .

最近领导让看一下数据库是否有问题,怀疑可能有注入,但也不能确认,随后要检查数据库,数据库太多了,我不可能一个一个的看,下面是通过SQL语句来实现,遍历查找:
declare @word nvarchar(20)
set @word=’5sejk.com’ //查找的字段中的内容
–取出数据库所有表名
declare tables 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)

declare @tablename sysname,@field sysname
open tables
fetch next from tables into @tablename,@field
while(@@fetch_status=0)
begin
declare @sql nvarchar(500)
set @sql= ’declare @count int; select @count=count(1) from ['+@tablename+'] where convert(nvarchar(100),['+@field+']) like ”’+'%’+@word+’%”;’+’if(@count>0) print ”’+@tablename+”+’(‘+”+@field+’)”’
exec(@sql)
fetch next from tables into @tablename,@field
end
close tables
deallocate tables

【原创】遍历数据库字段 有 36 条回应

  1. Wonderful article! That is the type of info that are supposed
    to be shared across the net. Shame on the search engines for no longer positioning
    this post higher! Come on over and discuss with my web
    site . Thanks =)

    回复
  2. What’s up to all, it’s truly a fastidious for me to pay
    a visit this web page, it contains helpful Information.

    回复
  3. The other day, while I was at work, my sister stole my apple
    ipad and tested to see if it can survive a 25 foot
    drop, just so she can be a youtube sensation. My apple ipad is now destroyed and she has 83 views.
    I know this is completely off topic but I had to share it with someone!

    回复
  4. Hey There. I found your weblog using msn. This
    is an extremely neatly written article. I’ll make sure to bookmark it and return to
    read more of your helpful info. Thank you for the post.
    I’ll certainly comeback.

    回复
  5. I have read so many posts concerning the blogger lovers however this post is in fact a nice paragraph, keep it up.

    回复
  6. I am really grateful to the holder of this web site who has shared this enormous post at here.

    回复
  7. Greetings! Very useful advice within this article!
    It’s the little changes that make the biggest changes. Thanks for sharing!

    回复
  8. you are truly a just right webmaster. The website loading velocity is amazing.

    It seems that you’re doing any distinctive trick. Furthermore, The
    contents are masterwork. you have performed a fantastic task in this subject!

    回复
  9. I think the admin of this web page is in fact working hard in support of his web site, because here every data is quality based information.

    回复
  10. Hello, i believe that i noticed you visited my site thus i
    got here to return the favor?.I’m trying to find things to improve my web site!I assume
    its adequate to use a few of your concepts!!

    回复
  11. Can I simply just say what a relief to uncover an individual who actually understands what they’re
    talking about online. You certainly understand how to bring an issue to
    light and make it important. More and more people must read this and understand this side
    of the story. I was surprised you’re not more popular
    given that you certainly have the gift.

    回复
  12. Yes! Finally something about ps4 games.

    回复
  13. Appreciation to my father who stated to me concerning this webpage, this webpage is really amazing.

    回复
  14. It’s a pity you don’t have a donate button! I’d certainly donate
    to this fantastic blog! I suppose for now i’ll settle for book-marking and adding your RSS
    feed to my Google account. I look forward to new updates and will talk about this website with my
    Facebook group. Talk soon!

    回复
  15. I couldn’t resist commenting. Well written!

    回复
  16. I think that is one of the most vital info for me. And i’m glad studying your article.
    However should remark on some general things, The website
    taste is ideal, the articles is really excellent :
    D. Excellent job, cheers

    回复
  17. Nice blog right here! Additionally your web site a lot up very fast!
    What host are you using? Can I am getting your associate hyperlink for your host?
    I wish my web site loaded up as quickly as yours lol

    回复
  18. Its not my first time to go to see this web page, i am browsing this site dailly and obtain good
    data from here everyday.

    回复
  19. I would like to thank you for the efforts you’ve put in writing this website.

    I’m hoping to see the same high-grade content from you later on as well.
    In truth, your creative writing abilities has
    motivated me to get my own, personal blog now 😉

    回复
  20. I’d like to find out more? I’d like to find out some additional information.

    回复
  21. Ahaa, its good dialogue on the topic of this article here
    at this weblog, I have read all that, so at this time me
    also commenting at this place.

    回复
  22. Yesterday, while I was at work, my sister stole
    my apple ipad and tested to see if it can survive a forty foot drop, just so she can be a youtube sensation. My iPad is now broken and she
    has 83 views. I know this is entirely off topic but I had to share it with someone!

    回复
  23. Nice post. I was checking constantly this blog and I am impressed!
    Extremely helpful info specially the last part :
    ) I care for such info a lot. I was seeking this particular information for
    a very long time. Thank you and good luck.

    回复
  24. Hi there, I think your blog could be having browser compatibility issues.
    Whenever I take a look at your website in Safari, it looks fine however,
    when opening in Internet Explorer, it’s got some
    overlapping issues. I simply wanted to provide you with a quick heads up!

    Apart from that, fantastic blog!

    回复
  25. It is in reality a great and helpful piece of information. I am satisfied that you shared this
    helpful info with us. Please stay us up to date like this.
    Thank you for sharing.

    回复
  26. is pfizer nebenwirkungen

    57d6 wow look it is is

    回复
  27. be is on line 40mg

    4a82 is versand ohne rezept

    回复
  28. be is oral jelly

    70e5 is female pink

    回复
  29. is ato collaterali

    82f8 farmacia de india is

    回复
  30. in tijuana viagra pharmacy buy

    回复
  31. is after effects

    fe25 prezzo basso di is

    回复
  32. venta is en peru

    05d6 try it best is

    回复
  33. consumo de is problemas

    9721 cheap is cheap is

    回复
  34. cheap off brand is

    cff1 is tiemp

    回复
  35. 5mg is lilly online

    0fe2 enter site being is

    回复
  36. is every day

    8ee0 is costo svizzera

    回复

发表评论

电子邮件地址不会被公开。 必填项已用*标注