SQL textcopy command with ColumnName as "File"

Hi Experts,
I have a SQL database table field named as "File" (poor file naming did by the developer).
And it's now deployed on the production.

textcopy.exe /S server01 /U user01 /P pwd01 /D DB01 /T tbl01 /C File /W "where id='999'" /Z /O /F form.pdf

PAUSE

Open in new window


When I try to extract the binary data on that field using text copy command it says


------------------------------------------------------------------------------------------------------------------------
  debug: Query: select File from tbl01 where id='999'
SQL Server 'server01' Message 156: Incorrect syntax near the keyword 'File'.
Concerning line 1)
DB-Library Error 10007: General SQL Server error: Check messages from the SQL S
rver.
ERROR: Query execution failed.
------------------------------------------------------------------------------------------------------------------------


It seems this "File" table column is identifying as a keyword. Could you please help me regarding this issue?
LVL 17
Dushan De SilvaTechnology ArchitectAsked:
Who is Participating?
 
James MurrellProduct SpecialistCommented:
Try putting file in square brackets [file]
0
 
Vijaya Reddy Pinnapa ReddyCommented:
Put the single quotes likes this 'form.pdf'

Also refer this
http://www.mssqlcity.com/articles/knowhow/textcopy.htm
0
 
Dushan De SilvaTechnology ArchitectAuthor Commented:
Thanks a lot!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.