Viewing 15 posts - 2,131 through 2,145 (of 4,080 total)
Two cups of coffee and feeling philosopical...
When I was a boy, and computers were carved from wood and cranked by hand, it was widely understood that hierarchical databases outperformed relational...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 22, 2009 at 7:40 am
INSERT INTO [DestinationDatabase].[dbo].[prempl]
.
.
.
SELECT
-- Employee_Master.Empno,
CONVERT(int,Employee_Master.Empno),
Employee_Master.Surname,
Employee_Master.GivenName,
.
.
.
FROM SQLSERVER.SourceDatabase.dbo.Employee_Master Employee_Master
.
...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 22, 2009 at 7:20 am
test (10/22/2009)
Wow, that's complex! - Thanks
You're welcome, Test. Just make that code a user-defined function and the complexity goes away.
Better yet, make it...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 22, 2009 at 7:11 am
"EAV" stands for Entity-Attribute-Value table, also derogatorily referred to as a "MUCK". (Massively Unified Code-Key table) While some people gravitate towards them because of their flexible...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 22, 2009 at 7:06 am
Thanks for the save, Allister. 🙂
At one point that occurred to me, because the usual concatenation routine pads the string on the left and right with separator characters....
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 22, 2009 at 6:59 am
To reduce logging and gain speed, you are probably going to wind up setting your db to simple recovery mode and then updating the tables in batches, rather than all...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 22, 2009 at 12:03 am
Thanks for coming back and posting your working code, Damien. It's a nice thing to do.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 21, 2009 at 10:06 pm
If you want performance, don't use a MUCK/EAV for one thing. 😉
Seriously, this type of table does not scale well and you will find yourself jumping...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 21, 2009 at 8:19 pm
"Easy" is a relative term. The following code is short, and should produce the same results, but I haven't tested for performance. Also, it's not nearly as...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 21, 2009 at 7:50 pm
I would have to see both query plans to give a definite answer, but this is my supposition.
By JOINING the tables you are adding the overhead of...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 21, 2009 at 5:59 pm
You can JOIN tables based on more than one column. It will work, even in the absence of compound keys or other indexes. Indexes may make...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 21, 2009 at 4:37 pm
Sigh... I always over-design things.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 21, 2009 at 4:16 pm
This is what you are inserting.
SELECT
Employee_Master.Empno,
You aren't converting the data in your SELECT, just in your JOIN. You need to convert it here for...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 21, 2009 at 3:15 pm
That'll work!!! I would have done it with a CROSS-APPLY like this, but for re-use an inline table valued function would be sweet. If...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 21, 2009 at 12:48 pm
Let's start over and go slowly.
Does your SELECT query display the results you expect when you run it without the INSERT statement?
If so, please post up some...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 21, 2009 at 10:46 am
Viewing 15 posts - 2,131 through 2,145 (of 4,080 total)