Community FAQ
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
wollseng
Engaged Sweeper II
I've created an SQL Query in MS SQM Managment Studio and tried it and it works fine. The problem is when i tries to use it in Lan Sweeper. I get the error message:"Incorrect syntax near the word 'Create' ".
Is it possible to use all SQL commands in LanSweeper?

The query I created is the following:

CREATE TABLE #Computers_All (
Computername int, Computer char (30) )

CREATE TABLE #Computers_Symantec (
Computername int, Computer char (30) )

INSERT INTO #Computers_All(Computername, Computer)
SELECT Computername, Computer
FROM tblComputers

INSERT INTO #Computers_Symantec(Computername, Computer)
SELECT tblComputers.Computername, tblComputers.Computer
FROM tblComputers INNER JOIN tblSoftware ON tblComputers.Computername = tblSoftware.ComputerName
WHERE ((tblSoftware.softwareName) Like 'Symantec Antivirus')

SELECT MIN(Computername) as Computername, Computer
FROM
(
SELECT computername, Computer
FROM #Computers_All
UNION ALL
SELECT Computername, computer
FROM #Computers_Symantec
) tmp
GROUP BY Computername, computer
HAVING COUNT(*) = 1
ORDER BY Computer


// Göran W
1 REPLY 1
Hemoco
Lansweeper Alumni
Lansweeper reports can only contain "select" statements.

Archive

This board contains archived posts from the retired Lansweeper Forum and Insiders Community.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now