all groups > sql server programming > october 2005 >
You're in the

sql server programming

group:

Table names as a join parameter


Table names as a join parameter laskowski NO[at]SPAM gmail.com
10/1/2005 6:18:02 PM
sql server programming: I am importing old DBF's into SQL, however I have an issue. There
are 400 tables, but the primary keys are table names. For example,
there is one main table "a" which has a column named Book, the rows
in this column link to other tables by their table name. So, the book
column has a row with an integer of 1 and the table which it joins with
is named "1".

Any ideas on how to de-normalize these and pump them into SQL using
TSQL?


CREATE TABLE a
(
Book int,
Data varchar(20)
)

CREATE TABLE 1
(
Data varchar(20)
MoreData varchar(20)
Re: Table names as a join parameter Jerry Spivey
10/1/2005 6:38:23 PM
Laskowski,

DTS or a linked server can be used to import the data from a DBF.

"de-normalize"? What is the desired result?

HTH

Jerry


[quoted text, click to view]

Re: Table names as a join parameter --CELKO--
10/1/2005 6:50:48 PM
WHY DID ANYONE A SCHEMA LIKE THIS??? You have mixed data and meta-data
in total violation of **fundamental** rules?? Run overthis person in
the parking lot before they kill children.

[quoted text, click to view]

Need you really mean "denormalize"? This is already total crap, there
is no way to make it worse.
Re: Table names as a join parameter Jerry Spivey
10/1/2005 7:06:30 PM
Joe,

It can get worse and it can get much, much better. Maybe we should focus on
helping this individual find a better way to correct something that was not
his/her fault in the first place rather than committing murder? If I were
in his shoes this would be my preference.

HTH

Jerry
[quoted text, click to view]

Re: Table names as a join parameter laskowski NO[at]SPAM gmail.com
10/1/2005 8:28:11 PM
Joe,

Knock off the flaming!

This application was written in Clipper back in 1990. A year in which
I was still wearing dippers.
Re: Table names as a join parameter laskowski NO[at]SPAM gmail.com
10/1/2005 9:04:14 PM
Joe,

Knock off the flaming! This application was written in Clipper back in
1990. A year in which I was still wearing diapers. Instead of
preaching from your ANSI standard high horse, step back and offer an
intelligent solution.
Re: Table names as a join parameter laskowski NO[at]SPAM gmail.com
10/1/2005 9:04:30 PM
Joe,

Knock off the flaming! This application was written in Clipper back in
1990. A year in which I was still wearing diapers. Instead of
preaching from your ANSI standard high horse, step back and offer an
intelligent solution.
Re: Table names as a join parameter David Portas
10/2/2005 2:59:18 AM
I hope you don't mean "de-normalize"! First design your *normalized*
data model, then import the data.

I think you'll need to write some code for this. If you do have an
xbase database available (Clipper, Fox, etc) then that may be the
natural way to consolidate the separate book tables.

In principle it's certainly possible in DTS too. Check out
www.sqldts.com for examples of how to build loops and then use a
dynamic properties task to import all your tables.

Alternatively, you might want to take a look at some 3rd party ETL
tools.

--
David Portas
SQL Server MVP
--
Re: Table names as a join parameter MeanOldDBA
10/2/2005 10:10:02 AM
:) Don't let Joe get to you. He's grown senile and angrier in his old age.
Everyone on here knows he's an a$@, so there's no reason to get excited about
it.

/punt
--
MeanOldDBA
derrickleggett@hotmail.com
http://weblogs.sqlteam.com/derrickl

When life gives you a lemon, fire the DBA.


[quoted text, click to view]
Re: Table names as a join parameter Ross Presser
10/3/2005 12:59:38 PM
[quoted text, click to view]

If you really were wearing diapers in 1990, perhaps it is a bit soon for
AddThis Social Bookmark Button