Viewing 15 posts - 3,481 through 3,495 (of 7,614 total)
bcp exports the results of a table, view or query, not the results of a procedure execution.
You'll need to capture the results of the proc into a table,...
April 3, 2018 at 12:11 pm
Great, I'm very glad it helped!
March 28, 2018 at 10:23 am
Much harder without consumable sample data, but something like below should be really close at least. I'm not 100% sure on the specific end date determination you want, but you...
March 23, 2018 at 2:40 pm
All taxing authorities I know of at least allow rounding of tax amounts, and afaik all businesses do it. After all, it's ultimately extra money to them to charge more...
March 23, 2018 at 12:11 pm
I don't believe there is, since the value is rounded up. You can calc the rate that would produce the rounded-up amount, but I can't see how you would ever...
March 23, 2018 at 11:25 am
I don't really see the need for the overhead and potential issues of reading the sys.all_columns view.
;WITH
cteTally10 AS (
SELECT * FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0))...
March 22, 2018 at 10:48 am
SELECT FieldName,
MAX(CASE WHEN ID = 2 THEN RecordCount END) AS OldCount,
MAX(CASE WHEN ID = 1 THEN RecordCount END) AS NewCount,
MAX(CASE WHEN...
March 21, 2018 at 2:30 pm
Prob not "the best way", but I think it works:
select ssalesid, salesname, salesamount_split, rank
from (
select 1 as ssalesid, 'cust1' as salesname, cast(101.50...
March 20, 2018 at 11:04 am
March 20, 2018 at 10:17 am
Are they covering indexes? Just having a nonclustered index on a joining column(s) is often not useful for SQL, unless that index fully covers the query.
I have had...
March 20, 2018 at 10:07 am
I prefer to use CROSS APPLY to assign an alias name, like below. Just to show the capability, I also used a CROSS APPLY to get the CONCAT'd column value:...
March 20, 2018 at 9:57 am
If the app is going to be reading the entire table anyway, if possible, use a clustered columnstore index.
March 20, 2018 at 8:19 am
Interesting article which brought up a great point about things to consider when writing code.
But you need to be fair to the "combined" code version. So let me...
March 20, 2018 at 8:12 am
If you want blanks rather than NULL, then:
CASE WHEN ALTotalUnits / TotalProfiledHours >= 3 THEN CAST(ALTotalUnits AS varchar(30)) ELSE '' END AS [Higher than 3 Weeks],
CASE WHEN...
March 20, 2018 at 7:40 am
Viewing 15 posts - 3,481 through 3,495 (of 7,614 total)