June 24, 2009 at 10:31 am
Good day all,
I am re-writing an existing Access app to SQL server 2000 and
I have just started to put a SP together and for reasons unknown the SP does not like the name of a particular table. The table is named 15cm and the code itself is simple enough:
SELECT *
INTO NewTable
FROM 15cm
GO
The 15cm table itself is fine, I can open and view it but SP does not like the syntax. I tried encasing it in both '' and "" but no joy. Using another table works fine so the syntax itself is OK but using the table I want to use throws a fit.
I can't believe the naming of the table is causing a problem so can any point out something I may have missed ?
Thanks in advance,
Mitch....
June 24, 2009 at 10:40 am
It is the naming that's causing a problem as a table name may not start with a number.
SELECT *
INTO NewTable
FROM [15cm]
GO
Just an additional note, if this is anything other than a once-off, consider specifying the columns and not using SELECT *
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 24, 2009 at 11:06 am
Thanks Gail, that worked perfect.
Cheers for the advice, at the moment I am just testing the tables but this may well become a monthly task so I may well list each field.
Thanks again,
Mitch.
June 24, 2009 at 2:20 pm
I would also question why you are moving to SQL Server 2000. You really should be moving to 2008 since that is the most current version of SQL Server. Moving to SQL Server 2000 just means you are going to have to upgrade later.
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
June 24, 2009 at 2:34 pm
I'd agree with Jeff here. If you have a 2008 instance, use that. If all you have are 2000 instances, then go with what you have.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply