Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The text of the spCheckForVehicleModelMatch stored procedure appears below but you can also find it in the Database Objects service if you installed the sample application.

Code Block
languagesql
CREATE PROC
spCheckForVehicleModelMatch 
                               (@SourceID INT,
                                @Year INT,
                                @Name NVARCHAR(255),
                                @ManufacturerID INT)
AS
SELECT MatchType, ID FROM 
(SELECT MatchType 
= CASE
                WHEN 
                                (Year = @Year AND
                                 Name = @Name AND
                                 ManufacturerID = @ManufacturerID AND
                                 ID <> @SourceID)
                THEN
                                1
                WHEN
                                (Name = @Name AND
                                 ManufacturerID = @ManufacturerID AND
                                 ID <> @SourceID)
                THEN
                                2
                END,

ID FROM APTIFY..vwVehicleModels) VehicleModelMatch
WHERE MatchType IS NOT NULL 

CREATE PROC spCheckForVehicleModelMatch
(@SourceID INT,
@Year INT,
@Name NVARCHAR(255),
@ManufacturerID INT)
AS
SELECT MatchType, ID FROM
(SELECT MatchType
= CASE
WHEN
(Year = @Year AND
Name = @Name AND
ManufacturerID = @ManufacturerID AND
ID <> @SourceID)
THEN
1
WHEN
(Name = @Name AND
ManufacturerID = @ManufacturerID AND
ID <> @SourceID)
THEN
2
END,

ID FROM APTIFY..vwVehicleModels) VehicleModelMatch
WHERE MatchType IS NOT NULL

Related topics

Filter by label (Content by label)
showLabelsfalse
sorttitle
showSpacefalse
labelsduplicate-records