Viewing 15 posts - 2,521 through 2,535 (of 7,608 total)
I posted a simplified query if you don't need to list/modify the individual values. To just subtract out the excluded values, you don't really need the CROSS APPLY:
January 16, 2020 at 4:47 pm
Given that the table had no index at all, I didn't think in this case that making the clus index unique was necessary, particularly to the extent of...
January 16, 2020 at 4:44 pm
Given that the table had no index at all, I didn't think in this case that making the clus index unique was necessary, particularly to the extent of adding the...
January 16, 2020 at 4:03 pm
Maybe use a separate view for each language you need. The view itself would be static but would be generated dynamically.
If you want to try this approach, and want further...
January 16, 2020 at 3:58 pm
looking at your execution plan, 9 million rows at 15 bytes per row is not very large, so it was able to read the entire table and do...
January 15, 2020 at 10:57 pm
SELECT
OT.Stuff1,
OT.Stuff2,
[...],
TotalStuff = TotalStuff -
...
January 14, 2020 at 10:23 pm
Shouldn't matter, unless it's part of a (much) larger transaction. A rowlock (at least) will be required to do the UPDATE anyway. But you could remove it, just in case.
Much...
January 14, 2020 at 10:18 pm
I'll assume that:
1) you have some way to get the OrderType from the OrderID since you'll need the Type to join to the Buck bits table as it's given
2) you...
January 14, 2020 at 9:31 pm
Thanks for the DDL. Yeah, the standard format of:
WHERE TransactionDate >= CAST(GETDATE() AS DATE))
will work just find for finding dates >= today at midnight.
Funny I actually tride to do a...
January 14, 2020 at 8:47 pm
I don't see how OPENQUERY would provide any performance benefit here. But, no, you can't create a temp table using OQ.
If you can provide more details of your specific situation,...
January 14, 2020 at 7:34 pm
Don't limit yourself to a single format. Just CAST it to date: if it's a valid date in any format, you'll get a date back. If not, you'll have to...
January 14, 2020 at 7:28 pm
I'm a noob, but what if you casted them as date so it doesnt include the time portion?
where CAST([TransactionDate] AS DATE)=CAST(GETDATE() AS DATE)
That seems like a slick solution. The...
January 14, 2020 at 6:40 pm
What is the data type of the TransactionDate column? If it's in the date/datetime category, then this condition:
where [TransactionDate] >= DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0)
should pull all rows on or...
January 14, 2020 at 5:52 pm
SQL can't execute the query as you've written it because there may be multiple values of T1.LineNUM for a given combination of DocEntry and ChapterID.
For example, suppose these two rows...
January 13, 2020 at 10:19 pm
Viewing 15 posts - 2,521 through 2,535 (of 7,608 total)