Link to home
Start Free TrialLog in
Avatar of CHI-LTD
CHI-LTDFlag for United Kingdom of Great Britain and Northern Ireland

asked on

SQL Script errors

Can anyone shed light on this?

6/9/2017 2:46:57 PM      domain\Administrator      ERROR: Error running SQL command '  IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[MARKETING_CONTROL_JOBS]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1) BEGIN    CREATE TABLE [dbo].[MARKETING_CONTROL_JOBS]  (   JOB_ID int NOT NULL IDENTITY (1, 1),   JOB_TYPE tinyint NOT NULL,   JOB_STATE tinyint NOT NULL,   SOURCE_ID uniqueidentifier NULL,   STAGE_ID uniqueidentifier NULL,   REFRESH_PARENTS bit NULL,   REFRESH_SOURCES bit NULL,   BLOCK_ACTIVITIES bit NULL,   NEW_RECIPIENTS_ONLY bit NULL,   START_DATE_TIME datetime NULL,   CREATED_DATE_UTC datetime NOT NULL,   UPDATED_DATE_UTC datetime NULL,   PROCESS_START_UTC datetime NULL,   PROCESS_END_UTC datetime NULL,   [USER_ID] uniqueidentifier NOT NULL,   RUN_ID uniqueidentifier NULL  )   ON [PRIMARY];    ALTER TABLE [dbo].[MARKETING_CONTROL_JOBS]   ADD CONSTRAINT PK_MARKETING_CONTROL_JOBS PRIMARY KEY CLUSTERED   (   JOB_ID  )   WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)   ON [PRIMARY];    CREATE INDEX [IX_MARKETING_CONTROL_JOBS__JOB_STATE__INCL_FLT]   ON [dbo].[MARKETING_CONTROL_JOBS]([JOB_STATE])  INCLUDE  (   [JOB_TYPE]   ,[SOURCE_ID]   ,[STAGE_ID]   ,[REFRESH_PARENTS]   ,[REFRESH_SOURCES]   ,[BLOCK_ACTIVITIES]   ,[NEW_RECIPIENTS_ONLY]   ,[START_DATE_TIME]   ,[PROCESS_START_UTC]   ,[PROCESS_END_UTC]   ,[USER_ID]   ,[RUN_ID]  )  WHERE [JOB_STATE] = 0; END;': Incorrect syntax near the keyword 'WHERE'.
6/9/2017 2:46:57 PM      domain\Administrator      ERROR: Incorrect syntax near the keyword 'WHERE'.. Source    at application.LiveUpdate.RunSQL(String sSQL)
6/9/2017 2:46:57 PM      domain\Administrator      ERROR: Incorrect syntax near the keyword 'WHERE'.. Source    at application.LiveUpdate.RunSQL(String sSQL)6/9/2017 2:46:57 PM      domain\Administrator      ERROR: Incorrect syntax near the keyword 'WHERE'.. Source    at application.LiveUpdate.InstallFile(String sHotFixGuid, String sDestination, String sType, String sFileGuid, String sValue)

Thanks
Avatar of ste5an
ste5an
Flag of Germany image

The SQL contains no error. Thus how is it executed? Against which SQL Server version?
Avatar of CHI-LTD

ASKER

It looks like its trying at add a new table.  its a downloaded file (unsure of type) and assuming its running SQL script.  SQL 2005 standard.
That was the missing part. Filtered indices where introduced with SQL Server 2008.

Thus you need either to upgrade your SQL Server or ask the vendor of that script.
Avatar of CHI-LTD

ASKER

Thats what they are saying: upgrade.
Avatar of CHI-LTD

ASKER

Thats what they are saying: upgrade.
ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CHI-LTD

ASKER

Thanks.  i had tried to copy and paste it into an sql script but failed miserably.
I'll try your out.

I agree, they will..

thanks