Viewing 15 posts - 436 through 450 (of 541 total)
The problem with using a case statement is that it isn't dynamic. The easiest way to do this dynamically is to use a temp table (in SQL 2k you...
October 20, 2003 at 7:32 pm
This seems like an incredibly dumb way to store data. Maybe I'm missing something, though...
If you're storing this data as text you're even more constrained as to what you...
October 20, 2003 at 1:36 pm
As long as you won't have problems with duplication, do a left join and look for a NULL (Like David said)...that's the fastest way.
Else, use a:
"Where Not Exists (Select 1....correlated...
October 20, 2003 at 1:30 pm
Really, the fastest way to do deletes is not to have any FK contraints at all.
🙂
I know this sounds crazy, but I've been working on a project...
October 20, 2003 at 1:24 pm
Super simple to do this...there's really no need for any complicated code.
1) Create table that exactly mimics your text file, except that it has an identity column.
2) Import all...
October 20, 2003 at 1:13 pm
delete p
From #People p (nolock)
JOIN#People p1 (nolock) on p.pName = p1.pName
wherep.pID > p1.Pid
Here's a extremely simple high performance way to do it in one statement:
Join the table to itself on...
October 17, 2003 at 12:51 pm
zaidk hit the nail on the head; by FAR the best way to do it. Use an IsNull() to replace the variable with the column value it's compared to.
When...
October 17, 2003 at 12:31 pm
I've got a really simple package that does this. As long as the structure and destination of the files is constant all you have to do is change the...
October 15, 2003 at 6:35 pm
It would look something like this:
Create proc TranExample
as
begin tran
--removes destination rows that match source rows
delete Destination
From Source
Where Destination.UniqueKey = Source.UniqueKey
--If there was an error rollback the tran and...
October 15, 2003 at 6:21 pm
Eureka! This was really bugging me, as I couldn't figure out why this was so difficult to do.
Concisely, find records where the NEXT Anniversary date is between the currentdate...
October 15, 2003 at 4:37 pm
Yeah Steve, I love the way you step through the Analysis process; the scenario you described is virtually identical to ones I've been through...over and over again.
October 15, 2003 at 1:58 pm
mcmcom,
Why do you keep trying to get us to do your homework for you? tsk tsk 🙂
The different between the 1st query and the 2nd query is that the 1st...
October 14, 2003 at 6:25 pm
termserv rox! I remember when I was working for nordstrom.com we got an early setup of Win2k. Once I saw terminal server I knew this OS would fly....
October 14, 2003 at 12:20 pm
Uh...Oh yeah. I think that's what this conversation was about...running a query for each database, not for each table.
For Table Names you should use:
select Table_Name
From INFORMATION_SCHEMA.Tables
The rest of the...
October 6, 2003 at 3:18 pm
-----------------------------------
Quote:
select name as 'TableName' from sysobjects where type = 'u'
------------------------------------
Like Frank said, though...querying system tables directly is risky, as they can change without warning.
select
Catalog_Name
from INFORMATION_SCHEMA.Schemata
Gives you the same results, and...
October 6, 2003 at 2:09 pm
Viewing 15 posts - 436 through 450 (of 541 total)