Viewing 15 posts - 406 through 420 (of 7,191 total)
Do you mean three columns at the same time? Yes, you can update as many as you like - provided (I think) they're all in the same table.
John
November 1, 2019 at 8:52 am
You have posted your own script suggestion. Does it work? If not, what is the problem - does it give an error message, does it not do what you intend...
October 31, 2019 at 12:02 pm
I think SUM(...) OVER(...) is the way to go, with the columns that are to be grouped by in your PARTITION BY clause.
John
October 28, 2019 at 4:54 pm
Presumably this will work:
COALESCE ('L' + LocationNo, 'A' + AsstNo) AS LocOrAsset
I use COALESCE instead of ISNULL - but that's just my preference. You will need to...
October 18, 2019 at 3:03 pm
No, it would just tell you there's nothing to do.
John
October 18, 2019 at 2:56 pm
I need to do it in single query and no dynamic sql.
Arbitrary requirements such as those make me suspect that this is a homework question. Please show us what...
October 18, 2019 at 8:18 am
What about storing it in the ring_buffer and just pulling it out of there?
That would work, but data in the ring buffer doesn't live for ever, so if you...
October 18, 2019 at 8:06 am
What do you see for the server in the Object Explorer window of SSMS?
John
October 17, 2019 at 3:57 pm
You're welcome. Do you understand how they work? Make sure you don't put them into production until you do, because you'll be responsible for their operation and maintenance.
John
October 17, 2019 at 3:02 pm
Use the LAG or LEAD function. Try it yourself, and post back if there's anything in particular that you struggle with.
John
October 17, 2019 at 1:28 pm
There's a similar function that you can use to read from an XE file. Granted, you still have to save to disk and then query the file at regular...
October 17, 2019 at 1:19 pm
Just needed to add a single line to my previous solution in order to take account of the weight requirement. Again, I've checked that the query runs, but I haven't...
October 17, 2019 at 11:21 am
Sign up for your local user group, go to the next meeting, and talk to people. There'll be people there who are looking for people to work for them. ...
October 17, 2019 at 11:07 am
Try this. There may be a slightly more elegant solution, but this should work. I haven't checked that the results are correct, because I'm wary about opening spreadsheets posted online.
October 17, 2019 at 10:53 am
SELECTCASE
WHEN columnA <> 0 THEN 1
ELSE columnB
END AS columnB
FROM MyTable;
John
October 17, 2019 at 9:40 am
Viewing 15 posts - 406 through 420 (of 7,191 total)