I am having trouble with bcp and field names that contain hypenscreate database testmegouse testmegocreate table test( [hy-phen] int)goinsert into testselect 1gocreate table loadme( [hy-phen] int)go--drop database testme
I then try and bcp usingbcp "testme..[test]" out "test.txt" -U"yourU" -P"yourP" -N -S yourdbbcp "testme..[loadme]" in "test.txt" -U"yourU" -P"yourP" -N -S yourdb
Out works fine, but trying to insert the data results in an error messageSQLState = 37000, NativeError = 170Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntaxnear '-'.
I am fairly certain it doesn't like the - in hy-pen, I have BoL'd and Google'd but I can't work out what switches to use to make this work..Any help/hints appreciated