October 28, 2008 at 2:18 pm
I have a customer on either SQL 2000 or SQL 7 that's running old software I'm trying to review for upgrading. Their schema utility reported to me a table like this:
CREATE TABLE GGDMI_metadata_updates_asof_16jun2008 (
Object Name varchar(8000),
Personality Heading varchar(8000),
Filingplace varchar(8000),
Medium code varchar(8000),
Used Date varchar(8000),
Headline varchar(8000),
Captions varchar(8000),
Series varchar(8000),
Photographer Status varchar(8000),
Title varchar(8000),
Created circa varchar(8000),
Merlin ID varchar(8000),
Trf varchar(8000),
Subject Month varchar(8000),
Subject day varchar(8000),
Subject Year varchar(8000),
Agency varchar(8000),
Country varchar(8000),
Date created varchar(8000),
Photographer varchar(8000),
Source varchar(8000),
City varchar(8000),
Reference number varchar(8000),
State varchar(8000),
Dupe code varchar(8000),
Subject Heading varchar(8000),
Published List varchar(8000))
GO
How do I recreate this table so the spaced columns will be supported? I don't know if the software my company deployed to them years ago is writing to this table or if it's something of their own doing for their own means. If the latter, then I can ignore the whole thing. But if the former, if I bracket the columnnames it may break some customization my company did that we don't know about (customer's work dates back 10 years).
October 28, 2008 at 2:35 pm
Using square brackets [] is the solution here.
As to the existing code, there is no reason that using brackets in the DML will break the running code.
October 29, 2008 at 5:42 am
Brackets are the way to go. If you used brackets within custom coding work in or around TSQL for anything other than naming database objects, you might be in trouble.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply