Tables with an ! crash Azure MW when BCP'ing data into SQL Azure


We recently had an issue with migrating a client's database to SQL Azure for an acceleration lab. The database had ~230 tables and kept crashing at some point in the BCP process.
We eventually tracked it down to a table that had the name something like dbo.DELETEME!_OLDTABLENAME
(Don't get me started on what this was doing in the database, but...)
It would seem that a table that has an exclamation mark in it crashes the Azure MW with an unhandled index out side or bounds exception. This ob course makes it pretty hard to track down what triggered the problem.


ghuey wrote Jan 26, 2012 at 2:34 AM

Hi, it is amazing the table names that people come up with . I have ran into this before and I had the regex check string hardcoded. So, I finally moved the regex string that checks for valid table characters and moved it to the app config file. Basically, I need to discover [schema].[table] from the BCP command and I have to create a regex string that returns
[schema] and [table] is two matches. Anyway, I added ! to the regex string and moved the string to the config file. Look for the key “SpecialTableCharacters” in the config file if you find another exception that needs to be added.

Check out v3.8.2 and let me know if it does not work for you.

Thanks for the catch!

wrote Feb 21, 2013 at 11:59 PM