Viewing 15 posts - 1,396 through 1,410 (of 2,645 total)
Jonathan AC Roberts wrote:I use this query to find the details of the last time a query was run
Could you explain please why the guid is there?
I don't think it's needed...
September 13, 2019 at 6:51 pm
I use this query to find the details of the last time a query was run
DECLARE @SqlIdentifier nvarchar(100) = 'uniqueBitOfTextInQuery'
SELECT TOP(1) -- 5A6A34DC-C45A-4AC1-80E8-5A65B3BE9F3F
...
September 13, 2019 at 4:35 pm
SQL Server is suggesting you try the following index:
USE [NetDB]
GO
CREATE NONCLUSTERED INDEX [IX_nsTransactionProperties_1]
ON [dbo].[nsTransactionProperties]([ToBePurgedDate])
INCLUDE ([DocumentId])
September 12, 2019 at 8:44 pm
SQL Server doesn’t have statistics for table variables like histograms and density vectors.
It always estimates the number of rows as 1, though I'm not sure if this is true for...
September 12, 2019 at 4:17 pm
re "for part no XXX708, it selects 3 warehouses with no activity but there are 2 more with recent sales"
I think the initial query I gave you should...
September 10, 2019 at 8:22 pm
re "for part no XXX708, it selects 3 warehouses with no activity but there are 2 more with recent sales"
I think the initial query I gave you should work:
September 10, 2019 at 6:23 pm
Hello Jonathan. I tried it, unfortunately, for part no XXX708, it selects 3 warehouses with no activity but there are 2 more with recent sales.
You just need to add
September 10, 2019 at 4:29 pm
SELECT fd.Warehouse,
I.StockCode,
I.Description,
fd.QtyOnHand,
...
September 10, 2019 at 2:00 pm
I'm not sure from your description exactly what you are trying to do but a NOT EXISTS clause should do the job for you.
SELECT fd.Warehouse,
...
September 10, 2019 at 1:16 pm
Drew's method is a better more efficient way of getting the data.
If you want to turn it into an UPDATE statement you will need to put the SELECT inside a...
September 9, 2019 at 11:06 pm
UPDATE x
SET x.v_i_L_4_d = z.sum_sales_amt,
x.v_L_4_d = z.sum_sales_items
FROM [dbo].[test_table] x
CROSS APPLY(SELECT SUM(w.sales_amt) sum_sales_amt,
...
September 9, 2019 at 5:19 pm
Has your stored procedure got a loop in it? If so it would be outputting an execution plan for each iteration of the loop.
September 9, 2019 at 4:54 pm
Have you tried editing SSIS packages with Notepad++?
You should be able to create one package that you will use as a template, make a copy of it for each table,...
September 9, 2019 at 2:52 pm
If it's a "poorly written query", why don't you just rewrite it?
September 6, 2019 at 2:23 pm
I'm not sure how many other queries you do on that table, but if this is the main query you would get much better performance by creating a unique clustered...
September 5, 2019 at 3:05 pm
Viewing 15 posts - 1,396 through 1,410 (of 2,645 total)