Viewing 15 posts - 7,306 through 7,320 (of 7,608 total)
SQLKnowItAll (7/16/2012)
ScottPletcher (7/16/2012)
Donald Bustell (7/16/2012)
Database: timetracking
Column: project varchar(50)
Questions:
1. What in the world???
2. How would I craft a trigger to just RTRIM everything on the way in?
Thanks
Donald
CREATE TRIGGER dbo.project_trg_ins
ON dbo.project
AFTER INSERT
AS
UPDATE...
July 16, 2012 at 2:18 pm
Something like below should do it:
SELECT
CASE WHEN backup_month IS NULL THEN 'ALL'
ELSE LEFT(DATENAME(MONTH, backup_month), 3) END AS...
July 16, 2012 at 2:13 pm
Donald Bustell (7/16/2012)
Database: timetracking
Column: project varchar(50)
Questions:
1. What in the world???
2. How would I craft a trigger to just RTRIM everything on the way in?
Thanks
Donald
CREATE TRIGGER dbo.project_trg_ins
ON dbo.project
AFTER INSERT
AS
UPDATE p
SET
...
July 16, 2012 at 1:56 pm
JayWinter (7/12/2012)
July 13, 2012 at 4:42 pm
Presumably the ContactID is indexed.
If there can only be single-line gaps, you can do this:
SELECT
c1.ContactID - 1 AS Missing_Number
FROM #Contact c1
WHERE NOT EXISTS...
July 13, 2012 at 4:11 pm
dan-572483
I was surprised to see that the Estimated Execution Plan shows a slightly higher cost for LEFT(LastName,2) over LIKE. The Plan for LIKE recommended creating a nonclustered index...
July 13, 2012 at 3:48 pm
Loner (7/13/2012)
Please seeLEFT() is a function it would result in an index scan where like '% %' would result in index seek which is more efficient.
Not quite.
LIKE 'xxx%' can...
July 13, 2012 at 3:41 pm
I don't think you really need indexing, since you can do everything in a single pass of the table, w/o JOINs, etc..
SELECT
ACTIONID,
CASE...
July 13, 2012 at 2:42 pm
Lynn Pettis (7/11/2012)
Matt Miller (#4) (7/11/2012)
Lynn Pettis (7/11/2012)
CREATE TABLE [dbo].[TEST1](
[ID] [VARCHAR](10) NULL,
[VALUE] [int] NULL
);
GO
INSERT INTO dbo.TEST1 (ID, VALUE) SELECT 1, 10;
SELECT 'PRE' LABEL1, * FROM dbo.TEST1;
DECLARE @SAVE1...
July 11, 2012 at 1:50 pm
Lynn Pettis (7/11/2012)
ScottPletcher (7/11/2012)
gerard-593414 (7/11/2012)
There are numerous...
July 11, 2012 at 12:29 pm
gerard-593414 (7/11/2012)
There are numerous users and want...
July 11, 2012 at 12:12 pm
I think the query below is equivalent to your original one, w/o all the unnecessary join (unless the join on DAY restricts the rows selected from the "report" table). ...
July 10, 2012 at 2:45 pm
cfradenburg (7/10/2012)
ScottPletcher (7/10/2012)
Jeff Moden (7/9/2012)
ScottPletcher (7/9/2012)
SELECT
(ident - 1) % 3,
MAX(CASE WHEN (ident - 1) % 3 = 0 THEN value ELSE 0...
July 10, 2012 at 11:11 am
Jeff Moden (7/9/2012)
ScottPletcher (7/9/2012)
SELECT
(ident - 1) % 3,
MAX(CASE WHEN (ident - 1) % 3 = 0 THEN value ELSE 0 END) AS...
July 10, 2012 at 8:33 am
SELECT
(ident - 1) % 3,
MAX(CASE WHEN (ident - 1) % 3 = 0 THEN value ELSE 0 END) AS part,
...
July 9, 2012 at 4:41 pm
Viewing 15 posts - 7,306 through 7,320 (of 7,608 total)