Viewing 15 posts - 1 through 15 (of 23 total)
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...
August 5, 2011 at 8:09 am
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!
May 28, 2010 at 10:21 am
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 ...
May 28, 2010 at 10:16 am
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...
April 9, 2010 at 9:39 am
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...
April 8, 2010 at 10:06 am
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...
April 8, 2010 at 9:42 am
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....
April 8, 2010 at 9:29 am
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...
January 29, 2010 at 10:33 am
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...
August 12, 2009 at 2:45 pm
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...
August 12, 2009 at 10:35 am
Awesome!! Thank you 🙂
June 12, 2009 at 1:04 pm
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...
June 12, 2009 at 10:30 am
Viewing 15 posts - 1 through 15 (of 23 total)