Viewing 15 posts - 3,616 through 3,630 (of 3,957 total)
Sean Lange (5/11/2012)
May 13, 2012 at 9:18 pm
If you need to fill in all the gaps created by your resolution, you may be able to use the following:
DECLARE @w TABLE (pkg_id INT, location INT, weight DECIMAL(9,2))
DECLARE @res...
May 13, 2012 at 9:09 pm
This may provide you the results set you seek:
;WITH CTE AS (
SELECT DTime, id, ticketid, actionlog
,(SELECT TOP 1 DTime
FROM #tmpmatt b
WHERE a.actionlog <> b.actionlog and a.DTime < b.DTime...
May 13, 2012 at 7:21 pm
This looks like a question I previously posted a solution to here:
http://www.sqlservercentral.com/Forums/Topic1290424-392-1.aspx
Even the field names are the same. Is this a homework problem or something?
May 13, 2012 at 6:31 pm
Do you mean something like this?
DECLARE @t TABLE (ID INT IDENTITY, FirstName VARCHAR(20), LastName VARCHAR(20))
INSERT INTO @t
SELECT 'Peter', 'Frampton'
UNION ALL SELECT 'Cold', 'Coffee'
UNION ALL SELECT 'Dwain', 'C'
SELECT ID
,(SELECT FirstName, LastName...
May 11, 2012 at 4:19 am
Sean Lange (4/19/2012)
No loops, no cursors.
Hey, wait a minute! That's part of my mantra! :w00t:
May 11, 2012 at 4:01 am
preetham gowda (5/11/2012)
Its continuation to my previous reply 🙂
Not actually as I'm using ROW_NUMBER() and not RANK().
May 11, 2012 at 3:42 am
vinu512 (5/11/2012)
You've nailed it Dwain. All this time I was thinking that I have done this before but wasn't able to remember how I did it. I tried everything except...
May 11, 2012 at 3:23 am
If I'm understanding, I think this will handle all 3 of your requirements. At least, the results match the 3 pictures you originally posted (with the possible exception of...
May 11, 2012 at 3:00 am
Vinus - I think there's a simpler solution with no need for dynamic SQL in the trigger.
--drop table temptable
Create Table temptable (id int not null primary key, val1 varchar(50),...
May 11, 2012 at 12:37 am
I think Kingston has nailed your question. You say these are your UPDATEs (formatted for readability):
Update dbo.DailyBchDataInitialInbound
Set BchCode = Substring (Name,5,3)
WHERE Name Like '%bch%' Or Name Like...
May 10, 2012 at 11:41 pm
Sean Lange (5/10/2012)
There was a story in another thread a few months ago by one of the regulars about a company that went belly up because their triggers couldn't handle...
May 10, 2012 at 6:45 pm
Glad you got it so quickly.
The issue about datatype of Days Since is a good demonstration of the need to provide DDL and sample data in a readily consumable format....
May 10, 2012 at 6:15 pm
stephen.sarre (5/10/2012)
DECLARE @match VARCHAR(30)
SET @match = '%[^a-zA-Z0-9@.,;!-!_!'''']%'
SELECT email...
May 10, 2012 at 4:45 am
Please do and tell us what you find.
I must confess though I ran a timing test on the 3 and found that mine was quite slow so take care with...
May 10, 2012 at 4:41 am
Viewing 15 posts - 3,616 through 3,630 (of 3,957 total)