Viewing 15 posts - 481 through 495 (of 2,647 total)
Oops... Change the cte query to this:
;WITH tagTypes (tagType)
AS
(Select '%-FRN%'
UNION
Select '%-BCK%'
UNION
Select '%-PPP%'
UNION
Select '%-MES%'
UNION
Select '%-MMT%')
CTEs cannot have the data type declared, it is implicit.
July 17, 2012 at 1:07 pm
Oh, got it and tested...
WHERE Agent = CASE WHEN @test <> '' THEN @test ELSE Agent END
July 17, 2012 at 1:04 pm
SQLKnowItAll (7/17/2012)
guerillaunit (7/17/2012)
WHERE CASE WHEN @test-2 <> '' THEN Agent = @test-2 ELSE --no where clause END
What is the correct...
July 17, 2012 at 1:00 pm
guerillaunit (7/17/2012)
WHERE CASE WHEN @test-2 <> '' THEN Agent = @test-2 ELSE --no where clause END
What is the correct structure...
July 17, 2012 at 12:59 pm
OH! You want all of those types no matter what. That is why you are doing that first... Ok. Do this:
;WITH tagTypes (tagType VARCHAR(10))
AS
(Select '%-FRN%' AS tagType
UNION
Select '%-BCK%'...
July 17, 2012 at 12:53 pm
neb2886 (7/17/2012)
http://sqlfiddle.com/#!3/f2bb4/1
The whole larger query is checking an anti-virus database for hosts within 5 different groups that have out of...
July 17, 2012 at 12:44 pm
Try changing your INNER JOIN IDENTITY_MAP IM to a LEFT JOIN IDENTITY_MAP IM
July 17, 2012 at 12:26 pm
neb2886 (7/17/2012)
For example, this query returned one row with MMT. However, I would like to receive...
July 17, 2012 at 12:24 pm
Ok, so just insert another CASE after our groupName:
SELECT DISTINCT SA.DELETED
,PAT.VERSION
,PAT.PATTERNDATE
,SA.AGENT_VERSION
,SCL.COMPUTER_NAME AS Computer_Name
,SCO.OPERATION_SYSTEM AS Operation_System
,dateadd(s, convert(BIGINT, SA.CREATION_TIME) / 1000, '01-01-1970 00:00:00') CREATION_DTTM
,dateadd(s, convert(BIGINT, SA.LAST_UPDATE_TIME) / 1000, '01-01-1970 00:00:00') Lastupdatetime
,DATEADD(s,...
July 17, 2012 at 11:59 am
Ok, now I am lost... What is the point of your 2nd query? It does nothing for you.
July 17, 2012 at 11:45 am
Ugh... Hold on, this is messed up... Give me a minute to fix.
July 17, 2012 at 11:43 am
Try this:
SELECT DISTINCT
SA.DELETED,
PAT.VERSION,
PAT.PATTERNDATE,
SA.AGENT_VERSION,
SCL.COMPUTER_NAME AS Computer_Name,
SCO.OPERATION_SYSTEM AS Operation_System,
dateadd(s,convert(bigint,SA.CREATION_TIME)/1000,
'01-01-1970 00:00:00') CREATION_DTTM,
dateadd(s,convert(bigint,SA.LAST_UPDATE_TIME)/1000,
'01-01-1970 00:00:00') Lastupdatetime,
DATEADD(s, convert(bigint,LAST_SCAN_TIME)/1000,
'01-01-1970 00:00:00')LAST_SCAN_TIME,
PAT.PATTERNDATE AS Pattern_Date,
SCL.USER_NAME AS User_Name,
VSC.IP_ADDR1_TEXT AS IP_Add,
CASE WHEN IM.NAME LIKE '%-FRN%' THEN IM.NAME
WHEN...
July 17, 2012 at 11:40 am
That error is saying that there is no column named tagType in the tagTypes table. In the second query, you have:
From
(
Select '%-FRN%' AS tagType
UNION
Select '%-BCK%' AS tagType
UNION
Select '%-PPP%' AS tagType
UNION
Select...
July 17, 2012 at 11:33 am
gerard-593414 (7/17/2012)
July 17, 2012 at 11:30 am
Google "sliding window SQL Server partitioning" That should get you started. Then come back with any specific questions.
July 17, 2012 at 10:15 am
Viewing 15 posts - 481 through 495 (of 2,647 total)