Skip to main content
 
Go Search
Home
Categories
Bloggers
Grab Binary SQL 2000 Data and SharePoint Content Quickly
By: Aaron Steele | Posted: September 16, 2006 at 11:46 AM

There is an undocumented utility in the BINN folder of SQL that will extract binary fields to files (or vice versa). The user has to be a SQL account, not a windows account and has to have read permissions on the table. This can be very useful when you need to extract information from the many binary fields in a SharePoint database. (Note: This utility is only supported in SQL 2000 and not in 2005.)

 

Here’s the syntax and an example:

 

TEXTCOPY [/S [sqlserver]] [/U [login]] [/P [password]]

  [/D [database]] [/T table] [/C column] [/W"where clause"]

  [/F file] [{/I | /O}] [/K chunksize] [/Z] [/?]

 

 

 
/S sqlserver The SQL Server to connect to. If 'sqlserver' is not specified, the local SQL Server is used.
/U login The login to connect with. If 'login' is not specified, a trusted connection will be used.
/P password The password for 'login'. If 'password' is not specified, a NULL password will be used.
/D database The database that contains the table with the text or image data. If 'database' is not specified, the default database of 'login' is used.
/T table The table that contains the text or image value.
/C column The text or image column of 'table'.
/W "where clause" A complete where clause (including the WHERE keyword) that specifies a single row of 'table'.
/F file The file name.
/I Copy text or image value into SQL Server from 'file'.
/O Copy text or image value out of SQL Server into 'file'.
/K chunksize Size of the data transfer buffer in bytes. Minimum value is 1024 bytes, default value is 4096 bytes.
/Z Display debug information while running.
/? Display this usage information and exit.
C:\Program Files\Microsoft SQL Server\MSSQL\Binn>TEXTCOPY /O /D PBCVirtu1_Site /T Docs /C Content /W"where Id = '{0A5498C4-BA8A-4206-8B02-206AAEE9DF8E}'" /F C:\temp\TempFile.doc /S 10.20.1.63 /U temp_recover /P *******


  Comments   Add Comment   Share It  
  Your Name:
  Your Email: **will not be displayed
  Comment Title:
* Comments:
  If you cannot read the code, please
click here to get a new one. You won't
lose your comments by doing so.
* Security Code:
   
  
  
* Your Name:
* Your Email: **will not be displayed
* Recipient's Email:
* Subject:
  If you cannot read the code, please
click here to get a new one. You won't
lose your comments by doing so.
* Security Code:
  
  
  
thanks for little known secret
By: Forex | Posted: January 5, 2009 at 11:58 AM
thanks for little known secret http://gheymatha.com فارکس
http://www.forex.co.ir
By: ftgfh | Posted: July 28, 2008 at 2:15 PM
http://www.forex.co.ir forex فارکس آموزش فارکس
Thanks
Posted: December 11, 2007 at 4:54 PM
This really helps me a lot.
This works Great!
Posted: March 2, 2007 at 10:50 AM
Thank you. I have been looking for an easy solution, better than a thousand lines of VB code. Good catch.
 

 About Jon Norton

Managing ConsultantJon Norton is a managing consultant for PointBridge. He has over 15 years of experience in the IT industry primarily in publishing and financial services software development. He is currently focused ... [more]

 Tag Cloud

 External Links

 ‭(Hidden)‬ Admin Links