I didn't see a mention of which version of SQL Server you're running,
but it sounds to me like canadianofficespacecom is either an object
owner or a schema:

http://www.sqlteam.com/article/understanding-the-difference-between-owners-and-schemas-in-sql-server

I'm assuming that it's most likely SQL Server 2005 or 2008, in which
case the simplest fix would probably be to change the default schema
for the user that you specified in your CF datasource. To do this,
access the properties for the user in question and you will see a
default schema field -- change the value to canadianofficespacecom and
you should then be able to query the tables without the prefix.

HTH,

--
Ezra Parker


On Fri, Dec 11, 2009 at 1:07 AM, Larry Soo <l...@bc4x4.com> wrote:
>
> I wrote:
>> > A client asked me to see if I could get a copy of his old web site up
> and
>> > running. I did a restore of the backed up database onto my PC. The
>> > problem is that all the table names have the name of the database
> prepended
>> > to them.
>> >
>> > When I view the tables in SQL Server Manager, the table, "city", is
> named
>> > "abc.city", where oldabc is the name of the database from which the
> data
>> > was backed up from. For the sake of this example, "newabc" is the
> database
>> > name I used on my own machine, to which the backup data was restored
> to.
>
>
> brad wrote:
>> I can't say I've ever seen that one before, but you could just do a loop
>> over the contents of INFORMATION_SCHEMA.TABLES and build/exec an ALTER
>> statement for each one.
>>
>> http://technet.microsoft.com/en-us/library/ms190273.aspx
>>
>> How many tables are there? If there are under 75, you might be just as
>> fast renaming them them by hand.
>
> Well, I tried renaming them by hand but it won't work.  Using the SQL
> Server Manger, I right-clicked on the table and then clicked on RENAME.
> The table name, when I right-clicked on it, said something like: abc.city.
> But when the RENAME edit box came up, it contained only "city".  So the
> table isn't actually named abc.city.  It is only presenting the table that
> way, and when I do a query in CF, it expects me to also refer to the table
> with that database name prefix.
>
> Hmm...ok, here's the exact scenario:
> 1) I'm imported the data from a backup file and named the database
> "canadianofficespace".
> 2) When I look at the tables in SQL Server Manager, it prefixes every table
> name with "canadianofficespacecom", which is not the name of the database.
> I presume it's the name of the database that it originally came from.
> 3) When I do a CFQuery, it won't work unless I write the table name as
> "canadianofficespacecom.city", instead of just "city".
>
> Can anyone help me out here?  This is well beyond my SQL Server knowledge.
>
> ...lars
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329080
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to