Forum Replies Created

Viewing 15 posts - 436 through 450 (of 541 total)

  • RE: Group by

    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...

  • RE: Report

    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...

  • RE: Comparison Query

    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...

  • RE: cascading deletes

    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...

  • RE: update and delete from a flat file

    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...

  • RE: Removing Duplicates

    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...

  • RE: help with stored procedure

    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...

  • RE: Input filename in DTS

    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...

  • RE: Help with SQL transactions

    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...

  • RE: DateDiff function

    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...

  • RE: When Do You Pull Your Hair Out?

    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.

  • RE: Help with simple query

    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...

  • RE: Terminal Services - A Couple Tips

    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....

  • RE: SELECT from all tables in the database

    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...

  • RE: SELECT from all tables in the database

    -----------------------------------

    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...

Viewing 15 posts - 436 through 450 (of 541 total)