Viewing 15 posts - 496 through 510 (of 1,468 total)
This is how I handle variable inputs
DECLARE @ProjectID int = 300;
DECLARE @ProjectName varchar(100) ...
August 22, 2019 at 12:36 pm
Thanks. That works fine. But the one issue that remains is there is a duplicate value for Bids in the NF is duplicated and there should be only one....
August 20, 2019 at 2:17 pm
Look at the progress we've got in SQL over the years!
what used to be 13 years ago a short inline formula using system functions and integer arithmetic is...
August 20, 2019 at 12:54 pm
Duplicate post
https://www.sqlservercentral.com/forums/topic/convert-seconds-to-minutes-2#post-3672679
August 20, 2019 at 10:13 am
Why are your seconds stored as strings? Convert them to integers, then this should do the trick.
SELECT *, [HH-MM-SS] = CAST(DATEADD(SECOND, l.Seconds, 0) AS time(0))
FROM ...
August 20, 2019 at 10:11 am
Sory @province is not 2 chars it's 1 char. That's the business rule i was asked to do so. 1 char from province 7 chars from Country with seq...
August 16, 2019 at 2:21 pm
You can create a tracking table and use a Quirky Update in a proc to do this
CREATE TABLE dbo.CountryProvNumber (
Country ...
August 16, 2019 at 1:58 pm
ok I understand that. And I think the end users would like that. the table would give them easier visibility to the rollups.
Let me work on that.
For performance reasons,...
August 12, 2019 at 3:08 pm
First just to be clear I am not a developer. I am just an accountant who knows enough SQL to get myself into these predicaments 🙂 So please be...
August 12, 2019 at 2:08 pm
You can add GROUP BY to Piet's code to ensure that you get distinct data for each EID and BID. Also change the 3rd parameter of STUFF from 1 to...
August 10, 2019 at 6:01 am
are you looking for this?
update #a
set a = case
when a = 0 then NULL
else a
end,
b = case
when b = 0 then...
August 6, 2019 at 3:30 pm
So here is a quick sample of how the DELETE can have unexpected results.
First, the data to work with
IF OBJECT_ID(N'tempdb..#DestTable', N'U') IS NOT NULL
BEGIN
DROP TABLE...
August 5, 2019 at 7:19 pm
I haven't used the MERGE statement since I got burned many years ago doing a
WHEN NOT MATCHED BY SOURCE THEN DELETE
As it turns out, you end up...
August 5, 2019 at 12:49 pm
DesNorton,
You mentioned:
The N'xxx' is an indicator that the contents between the quotes is unicode (which is what the function is expecting). The N'U' does in...
August 4, 2019 at 4:49 am
DesNorton,
I see what you are saying now. I was reading it wrong. But what about my second post where SQL says 'CK_isActive' is not a constraint? I...
August 2, 2019 at 4:26 am
Viewing 15 posts - 496 through 510 (of 1,468 total)