Forum Replies Created

Viewing 15 posts - 16 through 30 (of 38 total)

  • RE: Another query that takes too long

    One thing that may speed it up is the following:

    When possible, use isnull rather than the case statement.

    According to the execution plan, it is twice as fast.

    ie.

    replace this:

    CASE WHEN @Country...

  • RE: 4 hour plus query

    Actually I didn't express that correctly... I would return the 70 million rows into a new table and eventually run some aggregating queries on that.

  • RE: group by optimize

    The results are in:

    quote:


    WTF is a SARG?


    That's a searchable argument I think... when you look...

  • RE: indexes

    Here's a somewhat related question:

    These two tables have the exact same data (approximately 10 million rows):

    create table tImpression1 (userId numeric, time datetime, col1 int, col2 int, col3 int)

    create table tImpression2...

  • RE: Creating a Glossary

    I've never done it before but the first idea that comes to mind is as follows:

    create table tHyperlinkedTerms (hyperLinkedTermsId int IDENTITY, keyword varchar(100), description varchar(4000))

    create table tGlossary (glossaryId int IDENTITY,...

  • RE: sp output params not working in trigger

    Did you remember to specify the output parameter as an output?:

    exec proc_name @output_Param = @localVar OUTPUT

    This works on sql2000.... I don't know about 7.0

    drop table t1

    drop table t2

    drop procedure usp_test

    GO

    create...

  • RE: Too much deletion...

    ok I think that I get you now...

    join a table to itself on address and companyID

    and delete rows where response is a 4 for one and a 1 for the...

  • RE: Need to delete first character of a string

    update tblStreetData

    set streetName =

    case when substring(a.streetName,1,2) = 'N ' then substring(a.streetName,3,len(a.streetName)-2)

    when substring(a.streetName,1,2) = 'S ' then substring(a.streetName,3,len(a.streetName)-2)

    when substring(a.streetName,1,2) = 'E ' then substring(a.streetName,3,len(a.streetName)-2)

    when substring(a.streetName,1,2) = 'W ' then substring(a.streetName,3,len(a.streetName)-2)

    else streetName

    end

    from...

  • RE: group by part of a multi column primary key

    I think that it may be more of a data storage problem than a query problem...

    Here's another idea...I should have two tables with a 1 to 1 relationship (on id):

    create...

  • RE: Too much deletion...

    I think that this might work:

    DELETE #CL_FINAL

    FROM #CL_FINAL

    where CorrectResponseID = 1 or CorrectResponseID = 4

    Here is how I would delete based on joins to other tables:

    DELETE #CL_FINAL

    FROM #CL_FINAL

    join #anotherTable on...

  • RE: Need help with the logic - New at sql query

    This is a utility that I use to help with dates.

    Basically I create a temp table...

    create table #dateBuilder (date datetime, monthID int, month varchar(25),...

    Then insert into the temp table:

    insert into...

  • RE: indexing a 100 million row table

    Thanks very much for all the replies.

    As per bertovich's suggestion, I think that I'm going to work towards storing each days data in a separate table and use a partitioned...

  • RE: Error running xp_cmdshell

    Great tip... but I'm a little confused. Did that just show me what was previously already set, or did that set the environment variables for the user accessing dos from...

  • RE: Error running xp_cmdshell

    I didn't set the proxy account, but I'm not sure that it would be necessary since the account that runs the procedure already has system administrator priviledges.

    -J

  • RE: Error running xp_cmdshell

    A little more tinkering around and I found out some useful info:

    The following works from the command prompt but will not work from xp_cmdshell:

    perl e:\path\to\perlfile\importExcel.pl

    perl.exe e:\path\to\perlfile\importExcel.pl

    The following works from the...

Viewing 15 posts - 16 through 30 (of 38 total)