Viewing 15 posts - 1,951 through 1,965 (of 8,731 total)
There's no need for dynamic code. You just need to query a system view with a parameter.
SELECT SUM (row_count)
FROM sys.dm_db_partition_stats
WHERE object_id=OBJECT_ID(?)
AND index_id IN( 0, 1);
This will be...
October 31, 2016 at 8:43 am
I believe that Sean means something like this:
SELECT TOP 1 *
FROM(
SELECT TOP 1
CONCAT(i.BatchId,+'_'+ i.Company+'_',ltrim(rtrim(i.[Accounting Period]))+'_nondlo.saf')
, 1
...
October 31, 2016 at 8:24 am
Why don't you simply use
SELECT CONCAT(i.BatchId,+'_'+ i.Company+'_',ltrim(rtrim(i.[Accounting Period]))+'_nondlo.saf')
FROM [Havebury].[RepairInvoice].[RepairInvoiceNONDLO] i
Instead of using subqueries and CASE clauses?
October 31, 2016 at 8:04 am
Manic Star (10/31/2016)
Ed Wagner (10/31/2016)
Grumpy DBA (10/31/2016)
djj (10/31/2016)
RemingtonShaver
Beard
Lady
Marmalade
October 31, 2016 at 7:40 am
Steven.Grzybowski (9/27/2016)
Eric M Russell (9/26/2016)
Steven.Grzybowski (9/26/2016)
Inside that locked box is medication. Lots and lots of medication. My regularly prescribed daily meds, every OTC NSAID...
October 28, 2016 at 10:02 am
Lynn Pettis (10/28/2016)
Luis Cazares (10/28/2016)
Also, depending on the driver,...
October 28, 2016 at 9:40 am
Why aren't you using flat files to transfer the data so you don't have to deal with additional storage needed by spreadsheets?
Also, depending on the driver, you can get a...
October 28, 2016 at 8:56 am
I´m not sure what to say. You should know the deal by now. We need DDL, sample data and expected results.
The query that I posted gives the exact same result...
October 28, 2016 at 7:04 am
sqlfriends (10/27/2016)
I...
October 27, 2016 at 3:31 pm
halifaxdal (10/27/2016)
found a simple solution: select str(column)PS. the above query is producing wrong result, changing 1234565789 to 123456000, I'm keep searching for a simple solution now
That's because once the value...
October 27, 2016 at 1:37 pm
Include the columns in the derived table by using MIN or MAX on them.
Then use a CASE clause to update only when the row_count = 1.
October 27, 2016 at 12:56 pm
I think you're confusing the indexes created using DTA, with the indexes created during the DTA analysis but usually removed after the process completes. These later indexes are hypothetical and...
October 27, 2016 at 11:18 am
Thom A (10/27/2016)
Luis Cazares (10/27/2016)
This runs several times faster. I just can't understand why the FORMAT function is so slow.I really wish it wasn't. It's a lazy man's dream. :hehe:
I...
October 27, 2016 at 9:53 am
This runs several times faster. I just can't understand why the FORMAT function is so slow.
The TOP also prevents generating all the row numbers which gives an additional boost.
DECLARE @Hour_Quarter_ID...
October 27, 2016 at 9:45 am
Lynn Pettis (10/27/2016)
Luis Cazares (10/27/2016)
Here's an example of the different behavior of ROUND and CEILING/FLOOR.
Luis, your expected return values for the negative values are wrong. Rounding negative values up...
October 27, 2016 at 9:26 am
Viewing 15 posts - 1,951 through 1,965 (of 8,731 total)