Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8799671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:23:12+00:00 2026-06-14T00:23:12+00:00

I am trying to recreate a stored procedure on a database which is hosted

  • 0

I am trying to recreate a stored procedure on a database which is hosted on a remote server.
When creating the same SP locally I don’t get any errors but when I am trying to create the SP on the remote server I am getting this errors:

Msg 102, Level 15, State 1, Procedure MySP, Line 26
Incorrect syntax near 'MERGE'.
Msg 102, Level 15, State 1, Procedure MySP, Line 27
Incorrect syntax near 'S'.

Those errors are repeating in multiple SP and I didn’t get them when I created the SP’s on my local server.
Any idea what can that be?
Here is a sample SP:

USE [MyDatabase]
GO
/****** Object:  StoredProcedure [dbo].[InsertContractorInfo]    Script Date: 11/07/2012 01:08:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:      <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
--exec [dbo].[InsertContractorInfo] 
CREATE PROCEDURE [dbo].[InsertContractorInfo]
(@CompanyName nvarchar(50), 
 @LicenseNumber nvarchar(50),
 @MailingAddress1 nvarchar(200),
 @MailingAddress2 nvarchar(200),
 @Phone nvarchar(10),
 @Fax nvarchar(10),
 @Mobile nvarchar(10),
 @Email nvarchar(200),
 @PercentCommercial int,
 @PercentResidental int,
 @TotalEmployees int,
 @AnnualSales decimal(18,2),
 @InsuranceCompanyContact nvarchar(100)=null,
 @InsuranceCompanyContactEmail nvarchar(100)=null,
 @InsuranceCompanyContactPhone nvarchar(100)=null,
 @ContractorID uniqueidentifier)
AS
BEGIN
MERGE dbo.Contractor con
USING(SELECT 1 S) S
ON con.Oid = @ContractorID
WHEN MATCHED THEN UPDATE 
   SET       
      [CompanyName] = @CompanyName      
      ,[LicenseNumber] = @LicenseNumber
      ,[MailingAddress1] = @MailingAddress1
      ,[MailingAddress2] = @MailingAddress2
      ,[Phone] = @Phone
      ,[Fax] = @Fax
      ,[EMail] =@Email
      ,[Mobile] =@Mobile      
      ,[PercentCommercial] = @PercentCommercial
      ,[PercentResidental] = @PercentResidental
      ,[TotalEmployees] = @TotalEmployees
      ,[ApproximateAnnualSales] = @AnnualSales      
      ,[InsuranceCompanyContact] = @InsuranceCompanyContact
      ,[InsuranceCompanyContactPhone] = @InsuranceCompanyContactPhone
      ,[InsuranceCompanyContactEmail] = @InsuranceCompanyContactEmail      
WHEN NOT MATCHED THEN
INSERT 
           ([Oid]       
           ,[CompanyName]           
           ,[LicenseNumber]
           ,[MailingAddress1]
           ,[MailingAddress2]
           ,[Phone]
           ,[Fax]
           ,[EMail]
           ,[Mobile]                      
           ,[PercentCommercial]
           ,[PercentResidental]
           ,[TotalEmployees]
           ,[ApproximateAnnualSales]                      
           ,[InsuranceCompanyContact]
           ,[InsuranceCompanyContactPhone]
           ,[InsuranceCompanyContactEmail])
     VALUES
           (@ContractorId           
           ,@CompanyName           
           ,@LicenseNumber
           ,@MailingAddress1
           ,@MailingAddress2
           ,@Phone
           ,@Fax
           ,@EMail
           ,@Mobile
           ,@PercentCommercial
           ,@PercentResidental
           ,@TotalEmployees
           ,@AnnualSales                     
           ,@InsuranceCompanyContact
           ,@InsuranceCompanyContactPhone
           ,@InsuranceCompanyContactEmail
           );
END
GO

Thanks, Laziale

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:23:14+00:00Added an answer on June 14, 2026 at 12:23 am

    This merger feature works with sql sever 2008 + versions , if you are trying to use in sql server 2005 you can do like this merge mimic in 2005

    http://sqlserver-tips.blogspot.com/2006/09/mimicking-merge-statement-in-sql.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I started trying to recreate the buy button from the app store which requires
I am trying to recreate the program in Column 15 of programming pearls using
I am trying to recreate the Notes application. So far I got the following:
I've been trying to recreate an effect from this tutorial: http://jqueryfordesigners.com/jquery-look-tim-van-damme/ Unfortunately, I want
I'm trying to recreate the feature of Google Maps that changes the map type
I am trying to recreate this table in my rails 3 app. I believe
I'm making an MVC-framework in PHP and am trying to recreate a beautiful feature
First I'm going to show you an image of what I'm trying to recreate
this may sound funny, but i spent hours trying to recreate a knob with
I'm learning Objective C and iOS development. I'm trying to recreate some of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.