[dba-VB] Weird table name restriction

jwcolby jwcolby at colbyconsulting.com
Fri Nov 30 13:31:14 CST 2007


The strange part is that the code to create the table worked just fine, the
table was there.  The bulkinsert function just couldn't use it. 


John W. Colby
Colby Consulting
www.ColbyConsulting.com 
-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Friday, November 30, 2007 2:22 PM
To: dba-vb at databaseadvisors.com
Subject: Re: [dba-VB] Weird table name restriction

The problem is that they are fine (as are spaces) in file names...

I am doing a "copy file to temp table, copy temp to permanent".  Thus the
temp table name is just the file name.  I discussed awhile back that I got
an "in" or something similar as a file name, which collided with a reserve
word.  kind of the same issue only different.

What a PITA.  Keeps me searching for answers long after this thing should
just work.


John W. Colby
Colby Consulting
www.ColbyConsulting.com
-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust
Sent: Friday, November 30, 2007 2:11 PM
To: dba-vb at databaseadvisors.com
Subject: Re: [dba-VB] Weird table name restriction

Yep, dashes are as bad as spaces.  ;-}

Charlotte Foust

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Friday, November 30, 2007 11:04 AM
To: dba-sqlserver at databaseadvisors.com; dba-vb at databaseadvisors.com
Subject: [dba-VB] Weird table name restriction

I just discovered that SQL Server (or VB.Net) does not like dashes in table
names.

If I use a table name "ZIP4-AA_X", the BulkCopy.WriteToServer throws an
error "can't access destination table" but if I remove the dash "ZIP4AA_X"
it works just fine.

The problem is that I take the name of the datafile, strip off the extension
and use that as my table name.  Thus I now have to start doing edits of the
file name before I can use it as a field name.

The hoops we have to jump through...

John W. Colby
Colby Consulting
www.ColbyConsulting.com 

_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com


_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com

_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com




More information about the dba-VB mailing list