Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What would change my column names that have spaces in them

Status
Not open for further replies.

WhoWantsTacos

Programmer
Mar 18, 2011
13
US
I have a script of a couple of sprocs that involve some column names that have spaces in them. When I run the script on our test environment (includes the drop and create) it executes without issue. I can run the body of the sproc on production and it executes fine, however the process that we have to move things to production is suddenly transforming my column names that have spaces to append a . after every character so [First Name] becomes 'F.i.r.s.t. .N.a.m.e.' and then fails due to as an invalid name due to a null character.

Unfortunately, I don't have access to the DTS package that rolls our scripts into production but something is causing it to transform my column names. Does anyone have any idea what could cause this?

Thanks
 
COuld it be that the field is a NVARCHAR, (which I believe is a 2-byte per character), and you're reading it as a VARCHAR?

Just a shot in the dark here, but it seems like the periods may be "unprintable characters" that are being interpreted.

I may be way off base... but it's the first thing that popped into my mind.



Just my 2¢

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg
 
It's not the field itself but the field name that is being changed. I think it has something to do with the transformation process from the file that's being rolled into production into the SQL it is executing.
 
Many companies have a good standard of not allowing fields with spaces or other invalid characters on their name. It is possible that the process they have to promote code to production handles it on the way you mentioned as to cause it to fail.

You should most likely change your column names not to have the spaces on them in the first place.



Regards

Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884
FAQ181-2886
 
It's a table that already exists that I've inherited (I know enough to not have spaces in my column names). Oddly enough, the script previously was able to go into production and this time the only difference was I added a couple of fields to be returned that did not have spaces in their names.

I just wanted to see if anyone had come across a similar issue where invalid characters ended up in the script. I know it could be many things and it's really impossible to be able for me to investigate further since I don't have access to the DTS package (though the DBAs can but everyone knows how busy DBAs are :) ).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top