home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases.sybase
- Path: sparky!uunet!fmrco!bmyers
- From: bmyers@fmrco.COM (Brad Myers)
- Subject: Re: how to retrieve rows > X bytes (sortof)
- Message-ID: <1993Jan25.160152.5324@fmrco.uucp>
- Sender: news@fmrco.uucp
- Organization: Fidelity Management and Research Co., Boston, MA
- References: <1993Jan21.220509.17962@Princeton.EDU>
- Date: Mon, 25 Jan 1993 16:01:52 GMT
- Lines: 44
-
- In article <1993Jan21.220509.17962@Princeton.EDU> gpmenos@firestone.Princeton.EDU (Gerard Philippe Menos) writes:
- >Anyone know if it's possible to create a report showing the rows
- >(e.g., list values of key field) where the size (in bytes) of the row
- >is greater than X (e.g. 500K) [--we're dealing with images].
- >
- >Or, we could also solve our problem if dbcc (or some other approach)
- >could report the size of each row --then we'd find the rows we need on
- >a case-by-case basis. [The database is not large enough to preclude
- >this approach.]
- >
- >[What happened is that some images were accidentally scanned and
- >stored at a higher dpi than we would like to use; we would like to
- >identify which rows are holding images at the higher dpi, in order to
- >re-scan and re-store the images.]
- >
- >Thanks for any tips.
- >Phil
- >--
- >-------------------------------------------------------------
- >G. Philippe Menos [gpmenos@firestone.princeton.edu]
- >Systems Administrator, Princeton University Libraries
- >voice: 609-258-5183 fax: 609-258-5571
-
- Phil,
-
- Try using the datalength() function of TSQL on the column you are looking for.
-
- Example:
-
- select <blah>, <blah> from <table>
- where datalength(image_column) > 500000
-
- This should find the offending rows. I don't know of any easy way to get the
- total row size for each row, however, unless you wanted to add the datalength
- of each column together...
-
- Hope that helps...
- Brad
-
- --
- Bradley Myers | "Why me, John Big Boote?"
- bmyers@fmrco.com | "It might be booby-trapped"
- Fidelity Investments, Boston, MA | "Oh. Okay"
- The opinions expressed don't belong to anybody | -- TAoBBat8D
-