Viewing 15 posts - 31 through 45 (of 162 total)
Here is my take on the solution. Let me know if you see any issues.
WITH SortedData
AS (
SELECT Id, Pro, Type, Qty1, Qty2, ModifiedDate,
ROW_NUMBER() OVER (PARTITION BY...
March 20, 2019 at 2:27 pm
One thing to check is whether the login used for the SQL Agent has permissions to see the table in question, and to use the sp_send_dbmail procedure, and to create...
March 11, 2019 at 4:58 pm
I know the question has been answered, and the solution in this case did not need to run a statement on every database. However, that functionality is sometimes needed, and...
March 11, 2019 at 4:53 pm
I think you are trying to delete from Table1 where matching rows exist in Table2. If that is correct, then I think this is what you want:delete...
March 11, 2019 at 4:45 pm
The first thing to check is what indexes are being used to return data in each of the queries. My guess is that there are good indexes in the transactional...
March 11, 2019 at 4:33 pm
Look at the number of unique - distinct - values in the columns you are using. If there are not records in the table that have the same value, then...
March 11, 2019 at 4:23 pm
February 1, 2019 at 12:05 pm
OK, attempt #2. The CTE tells which rows are first and last in their block, the "Blocks" query puts those values into ranges, which can then be joined to the...
February 1, 2019 at 7:42 am
I took a stab at this one. I needed sample data, so I generated it using the following code. Because RAND is used with a predictable seed, the values will...
January 31, 2019 at 12:14 pm
By the way, the above code assumes no nulls in the Reading and Consumption fields. If there can be nulls, then the code should be adjusted to account for them...
January 31, 2019 at 11:26 am
SELECT P_Number,
Date,
MAX(CASE WHEN Extension = '' THEN Reading ELSE '' END) + ';' +
MAX(CASE WHEN Extension = 'P' THEN Reading ELSE '' END) + ';' +
January 31, 2019 at 11:20 am
I'll present two methods that I found to get the data. Thanks for posting the DDL; it was very helpful to have something to use for testing. If my solutions...
January 28, 2019 at 4:48 pm
I don't understand what you mean by "versioning purpose". Perhaps others don't either, which may be the reason that no one else has responded to your question. Please explain further. ...
January 23, 2019 at 9:29 am
If you know the names of the 35 tables, you should be able to build your table first, with the 35 column names you want to use.CREATE --...
January 16, 2019 at 2:43 pm
Viewing 15 posts - 31 through 45 (of 162 total)