Viewing 15 posts - 61 through 75 (of 13,847 total)
No problem. Just create a fake matching column in the STRUCTURE dataset (make sure its datatype matches what's in SOURCE)
SELECT Cols, Id
from Source
UNION ALL
Select Cols, Id...
April 3, 2025 at 2:57 pm
SELECT cols FROM TableA
UNION ALL
SELECT Cols FROM TableB b
WHERE NOT EXISTS (SELECT 1 FROM TableA a WHERE a.START = b.START)
April 3, 2025 at 1:10 pm
Something like this, perhaps?
UPDATE dt
SET dt.tagid = nt.id
FROM dbo.DataTable dt
JOIN dbo.OldTable ot
ON ot.id = dt.tagid
...
April 2, 2025 at 9:15 pm
Oh wait, I got it sorry
Bravo!
April 2, 2025 at 1:29 pm
Once you have created your set-based update code, consider adding an OUTPUT clause to it. This will allow you to capture the before and after state of the rows which...
April 2, 2025 at 12:05 pm
Not sure who marked your last post as spam, it wasn't me.
That is a mega query. Not one for someone who is 'new to the development side', in my opinion...
April 1, 2025 at 2:15 pm
I tried that and the columns still don't show up. It must be deeper in this mess. I'm still looking and again I appreciate your input.
There must be more...
April 1, 2025 at 1:29 pm
Right after the final ), add the following and see what happens:
SELECT d.Code
,d.CoName
,d.TerName
...
April 1, 2025 at 12:53 pm
Well, it should work, but without seeing your code, we cannot diagnose your issue. Try running this, for example
DROP TABLE IF EXISTS #SomeData;
CREATE TABLE #SomeData
(
...
April 1, 2025 at 12:19 pm
Good point Phil. I do believe DATEADD(year, -3, GETDATE()) Takes leap year into account, I'm too lazy to load test data. also I would not delete data from a...
April 1, 2025 at 7:27 am
On another note, you shouldn't be using double quotes around your field names. If you want to use anything, you should use open and close square brackets. "["...
March 31, 2025 at 8:13 pm
You can add to your SP after records are created or execute another SP that deletes the records over 3 years old. You need to have a date for...
March 31, 2025 at 7:51 pm
By fall off, do you mean get deleted?
Why not keep all the data and simply have a view which select the last three years?
Otherwise, create a daily SQL Agent job...
March 31, 2025 at 6:17 pm
Instead of moving processed files to a single archive folder, create a timestamped folder in the target folder and move the file there.
You will never get collisions if you do...
March 28, 2025 at 7:03 pm
Can you provide the relevant table structure and an insert statement that fails?
LOL... love seeing people ask for that.
You think it's funny that people are trying to help you...
March 28, 2025 at 4:40 pm
Viewing 15 posts - 61 through 75 (of 13,847 total)