home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / database / sybase / 736 < prev    next >
Encoding:
Text File  |  1993-01-25  |  2.1 KB  |  56 lines

  1. Newsgroups: comp.databases.sybase
  2. Path: sparky!uunet!fmrco!bmyers
  3. From: bmyers@fmrco.COM (Brad Myers)
  4. Subject: Re: how to retrieve rows > X bytes (sortof)
  5. Message-ID: <1993Jan25.160152.5324@fmrco.uucp>
  6. Sender: news@fmrco.uucp
  7. Organization: Fidelity Management and Research Co., Boston, MA
  8. References: <1993Jan21.220509.17962@Princeton.EDU>
  9. Date: Mon, 25 Jan 1993 16:01:52 GMT
  10. Lines: 44
  11.  
  12. In article <1993Jan21.220509.17962@Princeton.EDU> gpmenos@firestone.Princeton.EDU (Gerard Philippe Menos) writes:
  13. >Anyone know if it's possible to create a report showing the rows  
  14. >(e.g., list values of key field) where the size (in bytes) of the row  
  15. >is greater than X (e.g. 500K) [--we're dealing with images].
  16. >
  17. >Or, we could also solve our problem if dbcc (or some other approach)  
  18. >could report the size of each row --then we'd find the rows we need on  
  19. >a case-by-case basis. [The database is not large enough to preclude  
  20. >this approach.]
  21. >
  22. >[What happened is that some images were accidentally scanned and  
  23. >stored at a higher dpi than we would like to use;  we would like to  
  24. >identify which rows are holding images at the higher dpi, in order to  
  25. >re-scan and re-store the images.]
  26. >
  27. >Thanks for any tips.
  28. >Phil
  29. >-- 
  30. >-------------------------------------------------------------
  31. >G. Philippe Menos [gpmenos@firestone.princeton.edu]
  32. >Systems Administrator,   Princeton University Libraries
  33. >voice:  609-258-5183     fax:  609-258-5571
  34.  
  35. Phil,
  36.  
  37. Try using the datalength() function of TSQL on the column you are looking for.
  38.  
  39. Example:
  40.  
  41.      select <blah>, <blah> from <table>
  42.      where datalength(image_column) > 500000
  43.  
  44. This should find the offending rows.  I don't know of any easy way to get the
  45. total row size for each row, however, unless you wanted to add the datalength
  46. of each column together...
  47.  
  48. Hope that helps...
  49. Brad
  50.  
  51. -- 
  52.  Bradley Myers                                  | "Why me, John Big Boote?"
  53.  bmyers@fmrco.com                               | "It might be booby-trapped"
  54.  Fidelity Investments, Boston, MA               | "Oh. Okay"
  55.  The opinions expressed don't belong to anybody |     -- TAoBBat8D
  56.