Viewing 15 posts - 481 through 495 (of 5,393 total)
WITH duplicates AS (
SELECT *, RN = ROW_NUMBER() OVER(PARTITION BY CODCTB, CODCAE ORDER BY CODACTIVIDADE)
FROM dbo.ACT_SECUNDARIA
)
DELETE
FROM duplicates
WHERE RN > 1
Duplicates is the logical consequence to not adding...
-- Gianluca Sartori
May 26, 2015 at 3:43 am
Never seen anything like that before. SQL Server already has several HA features and I suspect that using SB for something it wasn't meant for would be a total train...
-- Gianluca Sartori
May 26, 2015 at 3:26 am
Steve Jones - SSC Editor (5/25/2015)
Jeff Moden (5/25/2015)
TomThomson (5/23/2015)
LinksUp (5/23/2015)
-- Gianluca Sartori
May 26, 2015 at 1:46 am
I managed to solve it with a recursive CTE.
WARNING: performance may be suboptimal.
DECLARE @replacements TABLE (
id int,
old varchar(50),
new varchar(50)
);
INSERT INTO @replacements
VALUES
(1,'abc', 'T1223'),
(2,'def', 'T456'),
(3,'ghi', 'T789'),
(4,'jkl', 'T1011'),
(5,'mno', 'T12');
DECLARE...
-- Gianluca Sartori
May 25, 2015 at 11:17 am
May 25, 2015 at 7:18 am
I never said the index won't be used with non SARG-able predicates: I said it cannot be searched.
SQL Server has no way to navigate the index b-tree structure to find...
-- Gianluca Sartori
May 25, 2015 at 3:30 am
LinksUp (5/23/2015)
-- Gianluca Sartori
May 25, 2015 at 2:36 am
In your example, the index will be uses. Since you're using the column only in the select list and no search predicate is present in the query, the nonclustered index...
-- Gianluca Sartori
May 25, 2015 at 2:10 am
I highly doubt it. RESTORE is an I/O intensive operation and RAM plays a very secondary role in the process. Backup compression can help improve restore elapsed times. If you're...
-- Gianluca Sartori
May 20, 2015 at 3:20 am
dwain.c (5/14/2015)
WayneS (5/14/2015)
GilaMonster (5/14/2015)
Over the years I've been very careful to keep my blog completely non-commercial, no adverts, no plugs for my company, nothing. Partially because...
-- Gianluca Sartori
May 15, 2015 at 1:40 am
Please post a script that anyone trying to help you could run on their machine.
We need table scripts, sample data and expected output.
See http://spaghettidba.com/2015/04/24/how-to-post-a-t-sql-question-on-a-public-forum/ for posting guidelines.
-- Gianluca Sartori
May 12, 2015 at 6:52 am
Not possible. Run the client application in the security context of the windows user using runas or any other impersonation mechanism.
-- Gianluca Sartori
May 12, 2015 at 5:01 am
Just reverse the NOT:
WITH examples AS
(
SELECT *
FROM (
VALUES
('ABG1226807'),
('@BC1224706'),
('AB!C1224706'),
('ABCZ122470'),
('AABC 122470')
) t(ex)
)
SELECT *...
-- Gianluca Sartori
May 12, 2015 at 4:59 am
I don't see how a WHILE loop can help you here.
-- Gianluca Sartori
May 12, 2015 at 3:17 am
BTW, SAN disk can be expensive, but NAS disks are cheap. You can always take your backups to a NAS (SMB shares are getting faster and more reliable with SMB3)...
-- Gianluca Sartori
May 12, 2015 at 3:15 am
Viewing 15 posts - 481 through 495 (of 5,393 total)