SQL Error (102): Incorrect syntax near '1'.

max27 posted 3 weeks ago in General

I've created a View "VSuperModelClassManufacturer" from a table Model having parent tables Class and Manufacturer (Model table having ClassKey and ManufacturerKey respectively), for testing purpose i've used required columns in View from these 3 tables. Instead of trigger for insert/update /delete made for this View. Everything was working fine in HeidiSQL portable editor then decided to add all columns of Model tables into View. But then update trigger started giving error "SQL Error (102): Incorrect syntax near '1'." Found that some columns are of type bit (cloaked, UDCheck1 etc..) so when View is not having them then all triggers are working fine but even if one is added to View then this error is coming(whether I try to change bit value or not). Can anyone help me to resolved this error? Gone through related queries in this forum but no solution for this error! What is tucking me is that there is one more column (Inactive) which is of type bit but that is not making error!

This is the design for Model table :

CREATE TABLE [dbo].[Model]( [ModelKey] [int] IDENTITY(1,1) NOT NULL, [ModelNo] nvarchar NULL, [ModelDescr] nvarchar NULL, [ManufacturerKey] [int] NOT NULL, [ClassKey] [int] NOT NULL, [PrefTeamKey] [int] NULL, [PrefVendorKey] [int] NULL, [PrefEmployeeKey] [int] NULL, [UDRisk1] [tinyint] NULL, [UDRisk2] [tinyint] NULL, [UDRisk3] [tinyint] NULL, [UDRisk4] [tinyint] NULL, [UDRisk5] [tinyint] NULL, [RiskScore] [int] NULL, [RiskPrior] [tinyint] NULL, [UserDef1] nvarchar NULL, [EstimatedLife] [tinyint] NULL, [Notes] [ntext] NULL, [cloaked] [bit] NULL, [UserMan] [bit] NULL, [TechMan] [bit] NULL, [UDCheck1] [bit] NULL, [UDCheck2] [bit] NULL, [UseUnit] nvarchar NULL, [CycleDate] [datetime] NULL, [AvgTimeSer] [int] NULL, [UseRule] nvarchar NULL, [CreatedOn] [datetime] NULL, [CreatedBy] [int] NULL, [ModifiedOn] [datetime] NULL, [ModifiedBy] [int] NULL, [ObsoleteOn] [datetime] NULL, [BenchmarkCost] [money] NULL, [UserDef2] nvarchar NULL, [UserDef3] nvarchar NULL, [ReplacementCost] [money] NULL, [Inactive] [bit] NULL, CONSTRAINT [PK_Model] PRIMARY KEY CLUSTERED ( [ModelKey] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

alexasamson posted 3 weeks ago

First off, I have been searching all over for an answer to this, and I am also new to SQL coding, so please bear with me. I have found help from and they provide me the great information. So you also go there if you want to know more.

Please login to leave a reply, or register at first.