Viewing 15 posts - 526 through 540 (of 3,489 total)
This will replace the values (overwrite them):
use tempdb;
go
CREATE TABLE Vals(Val VARCHAR(20));
GO
INSERT INTO Vals VALUES
('AAAB-AA-43-DDD-2')
,('RECA-AA-3-CCC-1')
,('RECA-AB-31-abc-1')
,('RECA-C-3-T');
UPDATE Vals
SET Val = REPLACE(Val,'RECA-','')
WHERE Val LIKE 'RECA-%';
If you just want to find them,...
June 14, 2021 at 6:24 pm
Can't you just add all the objects you want to be in every one of your databases to the model database?
if you want to add all the objects after the...
June 14, 2021 at 4:28 pm
I'm dumb as a rock, but wouldn't you do that with a delete trigger? Inside the trigger, you'd use the Deleted virtual table, and insert those records into some other...
June 9, 2021 at 3:36 pm
You don't need to return any columns inside the EXISTS clause. You could just write
WHERE EXISTS ( SELECT 1 FROM MyTable....)
June 9, 2021 at 4:59 am
4 hours seems excessive. Are the join columns on the two tables indexed? Did you look at the execution plan?
What's your SQL query look like? Something like this? (The FREEPROCCACHE...
June 9, 2021 at 3:46 am
I have a Problem in my code
Any tips ?
For starters, how about actually posting the code you're having a problem with?
The "most" bit is confusing. I thought you said you...
May 30, 2021 at 5:04 am
divide by the number of cars on an invoice?
Sounds like this would work most easily using AVERAGE windowing function. Just use the PARTITION BY part to do your grouping.
May 29, 2021 at 2:26 pm
Learning T-SQL in a few easy steps...
Congratulations.
"Reading Is Fundamental"...
May 28, 2021 at 1:28 am
The table does not have an index that I can use to speed up the join and I have tried using a where in clause so there is no Cartesian...
May 28, 2021 at 1:25 am
Seems like the obvious answer is to filter out the days where a table has no records. You could just use LAG() to get the previous recorded day's record count....
May 25, 2021 at 7:07 pm
Not totally sure I understand your question, but if you're wondering how to get the data from your stored procedure into Excel, it's pretty easy.
Go to Data tab, Get Data,...
May 25, 2021 at 3:56 pm
Well, here's a start at least...
May 23, 2021 at 11:09 pm
Okay, I feel stupid. I'm thinking I should be able to do this using a CTE and and update query. Would I have to convert this to a table-valued function...
May 20, 2021 at 5:59 pm
You need to use CROSS APPLY for this... the standard way of doing it (I'm gonna cheat and use Products and SalesLineItems) is like this:
SELECT p.ProductName, ca.SalePrice, ca.SalesQty, ca.SaleDate
FROM Products...
May 19, 2021 at 11:56 pm
Viewing 15 posts - 526 through 540 (of 3,489 total)