By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,649 Members | 2,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,649 IT Pros & Developers. It's quick & easy.

INSERT works in SQL server 2003 but NOT in SQL server 2000

P: 3
I am new to Infopath 2003, SQL server 2000 and SQL server 2003. I am calling up a stored procedure with 2 variables from jscript in infopath 2003 to run a stored procedure in SQL server 2003 to copy a record (@RecipetoCopy) and insert it with a new name(@RecipeNew). It works fine with SQL 2003 but it will not work in SQL 2000. Below is my stored procedure for both.


Code for 2005 work fine:
__________________________________________________ ________
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go

CREATE PROCEDURE [dbo].[CopyInsert]@RecipetoCopy varchar(10), @RecipeNew varchar(10)

AS

INSERT INTO [Epmar].[dbo].[Formulas]
([FormulaNumber],[Type1],[RawMat1],[Preset1],[Message1])

SELECT @RecipeNew,Type1,RawMat1,Preset1,Message1
from Formulas
where Formulas.FormulaNumber = @RecipetoCopy

SELECT * from Formulas
where Formulas.FormulaNumber = @RecipeNew
__________________________________________________ __________



Code for SQL 2000 does not work
__________________________________________________ __________
CREATE PROCEDURE CopyInsert @RecipetoCopy varchar(10), @RecipeNew varchar(10)

AS

INSERT Formulas
([FormulaNumber],[Type1],[RawMat1],[Preset1],[Message1])

SELECT @RecipeNew,Type1,RawMat1,Preset1,Message1
from Formulas
where Formulas.FormulaNumber = @RecipetoCopy

SELECT * from Formulas
where Formulas.FormulaNumber = @RecipeNew
GO
__________________________________________________ _______
Sep 19 '07 #1
Share this Question
Share on Google+
4 Replies


DonlonP
P: 25
I am new to Infopath 2003, SQL server 2000 and SQL server 2003. I am calling up a stored procedure with 2 variables from jscript in infopath 2003 to run a stored procedure in SQL server 2003 to copy a record (@RecipetoCopy) and insert it with a new name(@RecipeNew). It works fine with SQL 2003 but it will not work in SQL 2000. Below is my stored procedure for both.


Code for 2005 work fine:
__________________________________________________ ________
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go

CREATE PROCEDURE [dbo].[CopyInsert]@RecipetoCopy varchar(10), @RecipeNew varchar(10)

AS

INSERT INTO [Epmar].[dbo].[Formulas]
([FormulaNumber],[Type1],[RawMat1],[Preset1],[Message1])

SELECT @RecipeNew,Type1,RawMat1,Preset1,Message1
from Formulas
where Formulas.FormulaNumber = @RecipetoCopy

SELECT * from Formulas
where Formulas.FormulaNumber = @RecipeNew
__________________________________________________ __________



Code for SQL 2000 does not work
__________________________________________________ __________
CREATE PROCEDURE CopyInsert @RecipetoCopy varchar(10), @RecipeNew varchar(10)

AS

INSERT Formulas
([FormulaNumber],[Type1],[RawMat1],[Preset1],[Message1])

SELECT @RecipeNew,Type1,RawMat1,Preset1,Message1
from Formulas
where Formulas.FormulaNumber = @RecipetoCopy

SELECT * from Formulas
where Formulas.FormulaNumber = @RecipeNew
GO
__________________________________________________ _______

You've missed out the INTO on your INSERT statement in SQL 2000. It should be:

INSERT INTO Formulas
([FormulaNumber],[Type1],[RawMat1],[Preset1],[Message1])
Sep 27 '07 #2

debasisdas
Expert 5K+
P: 8,127
SQL server 2003 ???

From where you got that ?
Sep 27 '07 #3

P: 3
You've missed out the INTO on your INSERT statement in SQL 2000. It should be:

INSERT INTO Formulas
([FormulaNumber],[Type1],[RawMat1],[Preset1],[Message1])

It still does not work with the INSERT INTO Formulas.
Sep 28 '07 #4

P: 3
SQL server 2005 not 2003
Oct 3 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.