Forum Replies Created

Viewing 15 posts - 1 through 15 (of 23 total)

  • RE: T-SQL SELECT STATEMENT

    Have you considered selecting one record via a CTE then selecting from the CTE and unioning to another select statement where eventID and EVentDate do not equal the value from...

  • RE: Anatomy of an Incremental Load

    Love your tag 🙂

  • RE: SQL syntax

    lol! Too true! 😀

  • RE: SQL syntax

    Gotcha! The spacing between Select*from doesn't matter but there must be a space after from for the table name.... THanks for the learning!

  • RE: SQL syntax

    In testing out the theory (not pasting from the examples which inherently include a space before the table name)... only the second query runs without error:

    --WON'T RUN: select*fromUDM.DimDate ...

  • RE: Index suggestion for VERY large table

    Awesome! Thanks for posting!

  • RE: Index suggestion for VERY large table

    Have you also considered limitingthe dates via a join instead of the where criteria? A join is typically more powerful than a between or in list.

    SELECT a.Geography

    ,a.Product

    ,a.AsOf

    ,a.UPC_1

    ,a.WtdDist_1

    ,a.Dsales_1

    ,a.Csales_1

    ,a.Usales_1

    ,b.Brand

    ,CONVERT(DATETIME,(SUBSTRING(CONVERT(CHAR(8),a.AsOf),5,2)+'/'+RIGHT(CONVERT(CHAR(8),a.AsOf),2)+'/'+LEFT(CONVERT(CHAR(8),a.AsOf),2) ))

    AS...

  • RE: tuning the query which is having cursors

    Without knowing your output, here's some things that jump out to me as typically costly syntax:

    - Replace CURSORS with Set-based logic (as the previous post suggested), or, try a...

  • RE: Index suggestion for VERY large table

    Have you considered partitioning this table by date? If that's not a option then you will want either a clustered or non-clustered index on the date field. At...

  • RE: Office Cleaning

    I really liked this article and it came at a prime time: My team is preparing to give four classes over the next two weeks on Advanced SQL Training....

  • RE: Variable vs explicit value

    In this case, I typically add "OPTION (recompile)" ... Yes, it forces the server to come up with a new execution plan (adding time) but the new execution plan is...

  • RE: Query Question

    I assume that you're getting that error because you're selecting * from both tables in the row_number virtual table. Select only the columns that you need instead of selecting...

  • RE: Query Question

    I think I'm following you. . . Is this what you mean? (I've posted the original vs. the new)

    /* I am looking to extract data from the wce_ilr...

  • RE: Using a complex SP to provide data for a Crystal Report

    Awesome!! Thank you 🙂

  • RE: Using a complex SP to provide data for a Crystal Report

    Typically, temp tables only last for the length of the session. My understanding is that when you exec sp_[name] then it's essentially running the SP outside of your current...

Viewing 15 posts - 1 through 15 (of 23 total)