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:329078 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4