473,395 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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
4 1773
DonlonP
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
8,127 Expert 4TB
SQL server 2003 ???

From where you got that ?
Sep 27 '07 #3
MMCI
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
MMCI
3
SQL server 2005 not 2003
Oct 3 '07 #5

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

Similar topics

2
by: tdi1686 | last post by:
(Using a jet 4 oledb connection to an access 2000 db) I have a site that is programmed using Dreamweaver MX ASP.NET VB. I have several pages that update, and insert stuff into the access DB. ...
2
by: Christine.Misseri | last post by:
Hi all, I'm sure someone knows about this problem. I have an Access database designed in Access 2000, connected to an ORACLE 8i back end. On the ORACLE side I have stored procedures, triggers...
11
by: Ted | last post by:
OK, I tried this: USE Alert_db; BULK INSERT funds FROM 'C:\\data\\myData.dat' WITH (FIELDTERMINATOR='\t', KEEPNULLS, ROWTERMINATOR='\r\n');
0
by: patmg | last post by:
Hello, We use a SQL Server database to manage accounts in AD via a COM object using ADSI written in VB6. I have to move this database to a new server. The only real difference between the two...
14
by: Developer | last post by:
Hello All, i have recently installed VS2005 and was trying to install SQL sever 2000. I have Win XP' SP2. But when I tried installing, it only installed client tools and not the database. Can...
6
by: nild | last post by:
Hello i have a strange problem. I'm using LogonUser to impersonate the user under which my program must run. On Win XP or Server 2003 it works. But on 2000 it doesn't. So i found out, to set...
3
by: Dmitri | last post by:
Hello! I have a developer that is playing around with some SQL statements using VB.NET. He has a test table in a SQL 2000 database, and he has about 2000 generated INSERT statements. When the...
0
by: deepakgeorge | last post by:
We are trying to migrate databases and DTS from SQL Server 2000 to 2005. A BULK insert with in a DTS is failing showing the error. Bulk load data conversion error (type mismatch or invalid...
2
by: teddysnips | last post by:
I have an application that does some data manipulation of some tables to format a table for a report. 1. First I open the table that gives me the parameters for some later queries strSQL =...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.