473,387 Members | 1,812 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,387 software developers and data experts.

Return Key (identity) on INSERT operation (SQL/ASP)

CJM
I have the following SP:

CREATE PROCEDURE Orders_CreateOrder
@CustomerID int,
@LocationID int,
@CustOrderNo varchar(20),
@OrderDate smalldatetime
AS

Insert into Orders (CustomerID, LocationID, CustOrderNo, OrderDate)
Values (@CustomerID, @LocationID, @CustOrderNo, @OrderDate)
If @@RowCount > 0
Select Scope_Identity() as OrderID
GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

The theory is that if the Insert operation is successful, the key
(Scope_Identity) is returned.

If I try the following in QA, it works: Exec Orders_CreateOrder 1, 1,
'123d', '20040323'

However, in my ASP code, I get an error:
"Operation is not allowed when the object is closed."
ASP Snippet:
sSQL = "Exec Orders_CreateOrder " & _
Request.Form("CustomerID") & ", " & _
Request.Form("Depot") & ", '" & _
Request.Form("CustOrderNo") & "', '" & _
ISODate(Request.Form("OrderDate")) & "'"

Set rsOrders = oConn.Execute(sSQL)
Any ideas?

Cheers

Chris
Jul 19 '05 #1
24 2444
Add SET NOCOUNT ON in the beginning of your proc code.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"CJM" <cj*****@yahoo.co.uk> wrote in message
news:Of**************@tk2msftngp13.phx.gbl...
I have the following SP:

CREATE PROCEDURE Orders_CreateOrder
@CustomerID int,
@LocationID int,
@CustOrderNo varchar(20),
@OrderDate smalldatetime
AS

Insert into Orders (CustomerID, LocationID, CustOrderNo, OrderDate)
Values (@CustomerID, @LocationID, @CustOrderNo, @OrderDate)
If @@RowCount > 0
Select Scope_Identity() as OrderID
GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

The theory is that if the Insert operation is successful, the key
(Scope_Identity) is returned.

If I try the following in QA, it works: Exec Orders_CreateOrder 1, 1,
'123d', '20040323'

However, in my ASP code, I get an error:
"Operation is not allowed when the object is closed."
ASP Snippet:
sSQL = "Exec Orders_CreateOrder " & _
Request.Form("CustomerID") & ", " & _
Request.Form("Depot") & ", '" & _
Request.Form("CustOrderNo") & "', '" & _
ISODate(Request.Form("OrderDate")) & "'"

Set rsOrders = oConn.Execute(sSQL)
Any ideas?

Cheers

Chris

Jul 19 '05 #2
Tibor is correct, you need to add SET NOCOUNT ON at the beginning of your
stored procedure (in this case, on the line after AS). FWIW, I add this
line to EVERY stored procedure I create.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"CJM" <cj*****@yahoo.co.uk> wrote in message
news:Of**************@tk2msftngp13.phx.gbl...
I have the following SP:

CREATE PROCEDURE Orders_CreateOrder
@CustomerID int,
@LocationID int,
@CustOrderNo varchar(20),
@OrderDate smalldatetime
AS

Insert into Orders (CustomerID, LocationID, CustOrderNo, OrderDate)
Values (@CustomerID, @LocationID, @CustOrderNo, @OrderDate)
If @@RowCount > 0
Select Scope_Identity() as OrderID
GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

The theory is that if the Insert operation is successful, the key
(Scope_Identity) is returned.

If I try the following in QA, it works: Exec Orders_CreateOrder 1, 1,
'123d', '20040323'

However, in my ASP code, I get an error:
"Operation is not allowed when the object is closed."
ASP Snippet:
sSQL = "Exec Orders_CreateOrder " & _
Request.Form("CustomerID") & ", " & _
Request.Form("Depot") & ", '" & _
Request.Form("CustOrderNo") & "', '" & _
ISODate(Request.Form("OrderDate")) & "'"

Set rsOrders = oConn.Execute(sSQL)
Any ideas?

Cheers

Chris

Jul 19 '05 #3
My $0.02. In addition to Tibor and Aaron's comments, I'd avoid using a row
set and go with using an output parameter with your proc. It's more
efficient.

--
Tom

---------------------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Aaron Bertrand [MVP]" <aa***@TRASHaspfaq.com> wrote in message
news:#d**************@TK2MSFTNGP12.phx.gbl...
Tibor is correct, you need to add SET NOCOUNT ON at the beginning of your
stored procedure (in this case, on the line after AS). FWIW, I add this
line to EVERY stored procedure I create.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"CJM" <cj*****@yahoo.co.uk> wrote in message
news:Of**************@tk2msftngp13.phx.gbl...
I have the following SP:

CREATE PROCEDURE Orders_CreateOrder
@CustomerID int,
@LocationID int,
@CustOrderNo varchar(20),
@OrderDate smalldatetime
AS

Insert into Orders (CustomerID, LocationID, CustOrderNo, OrderDate)
Values (@CustomerID, @LocationID, @CustOrderNo, @OrderDate)
If @@RowCount > 0
Select Scope_Identity() as OrderID
GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

The theory is that if the Insert operation is successful, the key
(Scope_Identity) is returned.

If I try the following in QA, it works: Exec Orders_CreateOrder 1, 1,
'123d', '20040323'

However, in my ASP code, I get an error:
"Operation is not allowed when the object is closed."
ASP Snippet:
sSQL = "Exec Orders_CreateOrder " & _
Request.Form("CustomerID") & ", " & _
Request.Form("Depot") & ", '" & _
Request.Form("CustOrderNo") & "', '" & _
ISODate(Request.Form("OrderDate")) & "'"

Set rsOrders = oConn.Execute(sSQL)
Any ideas?

Cheers

Chris

Jul 19 '05 #4
>> My $0.02. In addition to Tibor and Aaron's comments, I'd avoid using a
row set and go with using an output parameter with your proc. It's more
efficient.


Yes, but the difference is negligible -- unless you're up into the thousands
of concurrent users. The verbose and troublesome command object syntax that
would be required in ASP to handle the alternative approach is hardly worth
the trouble, if the only reason is to use the "more efficient" output
variable. That's my $0.02, and though I'm in the states, it's on par with
your CDN$0.02. :-)

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #5
Actually, when you have a high number of inserts, it's not so negligible.
Craig Utley did a cool article on output vars vs. rowsets in SQL Server
Professional:

http://www.pinpub.com/html/main.isx?sub=64&story=729
He used ASP pages as a test harness. Craig seems to think that the payback
is in ADO - less overhead in handling the rowset than the output var.

I think I've seen similar writings elsewhere, perhaps in Bill Vaughn's
ADO/ADO.NET book.
--
Tom

---------------------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Aaron Bertrand [MVP]" <aa***@TRASHaspfaq.com> wrote in message
news:#n**************@TK2MSFTNGP12.phx.gbl...
My $0.02. In addition to Tibor and Aaron's comments, I'd avoid using a
row set and go with using an output parameter with your proc. It's more
efficient.


Yes, but the difference is negligible -- unless you're up into the thousands
of concurrent users. The verbose and troublesome command object syntax that
would be required in ASP to handle the alternative approach is hardly worth
the trouble, if the only reason is to use the "more efficient" output
variable. That's my $0.02, and though I'm in the states, it's on par with
your CDN$0.02. :-)

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #6
> I think I've seen similar writings elsewhere, perhaps in Bill Vaughn's
ADO/ADO.NET book.
I recall an article in SQLMag a few years back by Bill Vaughn where he
measured I believe a few thousand times improvements using out params
compared to a result set. This was, as I recall it, ADO and I believe that
Bill's assumption here as well was that the major part was in the ADO
handling.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Tom Moreau" <to*@dont.spam.me.cips.ca> wrote in message
news:uR**************@TK2MSFTNGP12.phx.gbl... Actually, when you have a high number of inserts, it's not so negligible.
Craig Utley did a cool article on output vars vs. rowsets in SQL Server
Professional:

http://www.pinpub.com/html/main.isx?sub=64&story=729
He used ASP pages as a test harness. Craig seems to think that the payback is in ADO - less overhead in handling the rowset than the output var.

I think I've seen similar writings elsewhere, perhaps in Bill Vaughn's
ADO/ADO.NET book.
--
Tom

---------------------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Aaron Bertrand [MVP]" <aa***@TRASHaspfaq.com> wrote in message
news:#n**************@TK2MSFTNGP12.phx.gbl...
My $0.02. In addition to Tibor and Aaron's comments, I'd avoid using a
row set and go with using an output parameter with your proc. It's more efficient.

Yes, but the difference is negligible -- unless you're up into the

thousands of concurrent users. The verbose and troublesome command object syntax that would be required in ASP to handle the alternative approach is hardly worth the trouble, if the only reason is to use the "more efficient" output
variable. That's my $0.02, and though I'm in the states, it's on par with
your CDN$0.02. :-)

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/

Jul 19 '05 #7
Again, this kind of performance gain is unlikely to be a factor when you're
dealing with one insert at a time. I understand, and stated earlier, that
is likely to be worth pursuing when you're at high volume.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Tibor Karaszi" <ti***************************@hotmail.nomail.co m> wrote in
message news:%2****************@TK2MSFTNGP09.phx.gbl...
I think I've seen similar writings elsewhere, perhaps in Bill Vaughn's
ADO/ADO.NET book.


I recall an article in SQLMag a few years back by Bill Vaughn where he
measured I believe a few thousand times improvements using out params
compared to a result set. This was, as I recall it, ADO and I believe that
Bill's assumption here as well was that the major part was in the ADO
handling.

Jul 19 '05 #8
Tom, The SQL Pro link seems to be dead. I get a blank page when I try it.

From what I've read in both Bill Vaughn's and David Sceppa's books, you are
both correct that the major impact was in the ADO handling. Yes, there is
some overhead in SQL Server itself to create the cursor, but passing the
cursor across processes, creating the recordset object to receive the
cursor, and initializing the ADO cursor library was where the main impact
would be seen.

In fact, Bill goes on to maintain that using a recordset to retrieve a
single record is never warranted. While I agree in principle with him, I
usually take the easy way and use a recordset, especially when a large
number of columns is involved. Bill made the point that, in an interpreted
language such as vbscript, using a large number of CreateParameter
statements might negate the performance benefits gained from using output
parameters instead of a recordset, due to the need to compile all those
statements every time.

And yes, Aaron is correct: creating all those CreateParameter statements can
be error-prone and hard to debug. That is why I use a code generator.
There's a VB addin for this available on Bill's site www.betav.com. I
adapted it (and fixed a couple of problems in the process) for vbscript.
It's available here:
http://www.thrasherwebdesign.com/ind...s&hp=links.asp

Bob Barrows

Tibor Karaszi wrote:
I think I've seen similar writings elsewhere, perhaps in Bill
Vaughn's ADO/ADO.NET book.


I recall an article in SQLMag a few years back by Bill Vaughn where he
measured I believe a few thousand times improvements using out params
compared to a result set. This was, as I recall it, ADO and I believe
that Bill's assumption here as well was that the major part was in
the ADO handling.
"Tom Moreau" <to*@dont.spam.me.cips.ca> wrote in message
news:uR**************@TK2MSFTNGP12.phx.gbl...
Actually, when you have a high number of inserts, it's not so
negligible. Craig Utley did a cool article on output vars vs.
rowsets in SQL Server Professional:

http://www.pinpub.com/html/main.isx?sub=64&story=729
He used ASP pages as a test harness. Craig seems to think that the
payback is in ADO - less overhead in handling the rowset than the
output var.

I think I've seen similar writings elsewhere, perhaps in Bill
Vaughn's ADO/ADO.NET book.
--
Tom

---------------------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Aaron Bertrand [MVP]" <aa***@TRASHaspfaq.com> wrote in message
news:#n**************@TK2MSFTNGP12.phx.gbl...
My $0.02. In addition to Tibor and Aaron's comments, I'd avoid
using a row set and go with using an output parameter with your
proc. It's more efficient.


Yes, but the difference is negligible -- unless you're up into the
thousands of concurrent users. The verbose and troublesome command
object syntax that would be required in ASP to handle the
alternative approach is hardly worth the trouble, if the only reason
is to use the "more efficient" output variable. That's my $0.02,
and though I'm in the states, it's on par with your CDN$0.02. :-)

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #9
Bob,

Thanx for this. I just tried the SQL Pro website and it's up.

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
..
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:OY**************@tk2msftngp13.phx.gbl...
Tom, The SQL Pro link seems to be dead. I get a blank page when I try it.

From what I've read in both Bill Vaughn's and David Sceppa's books, you are
both correct that the major impact was in the ADO handling. Yes, there is
some overhead in SQL Server itself to create the cursor, but passing the
cursor across processes, creating the recordset object to receive the
cursor, and initializing the ADO cursor library was where the main impact
would be seen.

In fact, Bill goes on to maintain that using a recordset to retrieve a
single record is never warranted. While I agree in principle with him, I
usually take the easy way and use a recordset, especially when a large
number of columns is involved. Bill made the point that, in an interpreted
language such as vbscript, using a large number of CreateParameter
statements might negate the performance benefits gained from using output
parameters instead of a recordset, due to the need to compile all those
statements every time.

And yes, Aaron is correct: creating all those CreateParameter statements can
be error-prone and hard to debug. That is why I use a code generator.
There's a VB addin for this available on Bill's site www.betav.com. I
adapted it (and fixed a couple of problems in the process) for vbscript.
It's available here:
http://www.thrasherwebdesign.com/ind...s&hp=links.asp

Bob Barrows

Tibor Karaszi wrote:
I think I've seen similar writings elsewhere, perhaps in Bill
Vaughn's ADO/ADO.NET book.


I recall an article in SQLMag a few years back by Bill Vaughn where he
measured I believe a few thousand times improvements using out params
compared to a result set. This was, as I recall it, ADO and I believe
that Bill's assumption here as well was that the major part was in
the ADO handling.
"Tom Moreau" <to*@dont.spam.me.cips.ca> wrote in message
news:uR**************@TK2MSFTNGP12.phx.gbl...
Actually, when you have a high number of inserts, it's not so
negligible. Craig Utley did a cool article on output vars vs.
rowsets in SQL Server Professional:

http://www.pinpub.com/html/main.isx?sub=64&story=729
He used ASP pages as a test harness. Craig seems to think that the
payback is in ADO - less overhead in handling the rowset than the
output var.

I think I've seen similar writings elsewhere, perhaps in Bill
Vaughn's ADO/ADO.NET book.
--
Tom

---------------------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Aaron Bertrand [MVP]" <aa***@TRASHaspfaq.com> wrote in message
news:#n**************@TK2MSFTNGP12.phx.gbl...
My $0.02. In addition to Tibor and Aaron's comments, I'd avoid
using a row set and go with using an output parameter with your
proc. It's more efficient.


Yes, but the difference is negligible -- unless you're up into the
thousands of concurrent users. The verbose and troublesome command
object syntax that would be required in ASP to handle the
alternative approach is hardly worth the trouble, if the only reason
is to use the "more efficient" output variable. That's my $0.02,
and though I'm in the states, it's on par with your CDN$0.02. :-)

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #10
I don't get it. I'm registered, but when I follow your link (or do a site search and follow that link) all I get is a blank frame - their outer frame shows up all right, it's the article itself that is missing .... I've sent them an email.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From header is my spam trap, so I don't check it very often. You will get a quicker response by posting to the newsgroup.
"Tom Moreau" <to*@dont.spam.me.cips.ca> wrote in message news:eg**************@TK2MSFTNGP10.phx.gbl...
Bob,

Thanx for this. I just tried the SQL Pro website and it's up.

--

Jul 19 '05 #11
Bob,

I think I see your problem, though I don't know what caused it. Try getting
at it this way:

http://www.pinpub.com/html/main.isx?sub=38&auth=212

This gets you to Craig's author page. Then click on the article and it
brings it up.

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
..
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:uy**************@TK2MSFTNGP10.phx.gbl...
I don't get it. I'm registered, but when I follow your link (or do a site
search and follow that link) all I get is a blank frame - their outer frame
shows up all right, it's the article itself that is missing ... I've sent
them an email.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From header is
my spam trap, so I don't check it very often. You will get a quicker
response by posting to the newsgroup.
"Tom Moreau" <to*@dont.spam.me.cips.ca> wrote in message
news:eg**************@TK2MSFTNGP10.phx.gbl...
Bob,

Thanx for this. I just tried the SQL Pro website and it's up.

--

Jul 19 '05 #12
CJM
Thanks for the responses guys.

I still have a little problem.... I'm updating the SP to include SET NOCOUNT
ON, and when I run the ALTER statement in QA it works... but when I look at
the SP again, the NOCOUNT lines are missing...

And needless to say the ASP page still doesnt work..

Any ideas?

Thanks
Jul 19 '05 #13
Can you show us the procedure code (or the beginning of the code)?

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"CJM" <cj*****@yahoo.co.uk> wrote in message
news:eC**************@TK2MSFTNGP11.phx.gbl...
Thanks for the responses guys.

I still have a little problem.... I'm updating the SP to include SET NOCOUNT ON, and when I run the ALTER statement in QA it works... but when I look at the SP again, the NOCOUNT lines are missing...

And needless to say the ASP page still doesnt work..

Any ideas?

Thanks

Jul 19 '05 #14
CJM
Tibor,

Here's the full SP code:

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

/****** Object: Stored Procedure dbo.Orders_CreateOrder Script Date:
24/03/2004 09:41:39 ******/

ALTER PROCEDURE Orders_CreateOrder
@CustomerID int,
@LocationID int,
@CustOrderNo varchar(20),
@OrderDate smalldatetime
AS

Insert into Orders (CustomerID, LocationID, CustOrderNo, OrderDate)
Values (@CustomerID, @LocationID, @CustOrderNo, @OrderDate)

Select Scope_Identity() as OrderID

GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
No matter what I do, the NOCOUNT lines disappear, and the
QUOTED_IDENTIFIER/ANSI_NULLS lines appear. I went so far as deleting the SP,
and recreating it with SET NOCOUNT ON, but not including the other settings,
but when I look back they, everything is back to as it was...

Help!

Chris
Jul 19 '05 #15
> No matter what I do, the NOCOUNT lines disappear, and the
QUOTED_IDENTIFIER/ANSI_NULLS lines appear.
It is no surprise that the QUOTED_IDENTIFIER and ANSI_NULLS commands
disappears as you set them *outside* the procedure code. These two are
"sticky parameters" meaning that the proc will have the setting you had in
the connection from where you *created* the proc.

All other options you need to set *inside* the procedure code.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"CJM" <cj*****@yahoo.co.uk> wrote in message
news:OV**************@TK2MSFTNGP12.phx.gbl... Tibor,

Here's the full SP code:

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

/****** Object: Stored Procedure dbo.Orders_CreateOrder Script Date:
24/03/2004 09:41:39 ******/

ALTER PROCEDURE Orders_CreateOrder
@CustomerID int,
@LocationID int,
@CustOrderNo varchar(20),
@OrderDate smalldatetime
AS

Insert into Orders (CustomerID, LocationID, CustOrderNo, OrderDate)
Values (@CustomerID, @LocationID, @CustOrderNo, @OrderDate)

Select Scope_Identity() as OrderID

GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
No matter what I do, the NOCOUNT lines disappear, and the
QUOTED_IDENTIFIER/ANSI_NULLS lines appear. I went so far as deleting the SP, and recreating it with SET NOCOUNT ON, but not including the other settings, but when I look back they, everything is back to as it was...

Help!

Chris

Jul 19 '05 #16
CJM
Tibor,

Thanks...

After a few guesses, I've finally figured the correct syntax...!

All appears to be working now, though it is no thanks to Books Online, which
was as much use as a chocolate teapot!

Thanks again for you efforts and you prompt response...

Chris
Jul 19 '05 #17
Jul 19 '05 #18
Jul 19 '05 #19
Jul 19 '05 #20
Jul 19 '05 #21
Jul 19 '05 #22
Jul 19 '05 #23
Jul 19 '05 #24
Jul 19 '05 #25

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Edward | last post by:
SQL 7.0 I have a form in ASP.NET and I want to write the values to the SQL Server tables. The tables are Customer and Address tables. There will be an insert into the Customer table, and I...
4
by: Paul | last post by:
Hi, In SQL Books Online in the section on @@Error it gives the following example: -- Execute the INSERT statement. INSERT INTO authors (au_id, au_lname, au_fname, phone, address, city,...
3
by: Chris Gilbert | last post by:
I'm quite stuck with this: I have an import table called ReferenceMatchingImport which contains data that has been sucked from a data submission. The contents of this table have to be imported...
10
by: ree32 | last post by:
I am inserting a record into a table that automatically generates unique ids (i.e. Primary Key). Is there anyway to return this id. As I am using this on ASP.net page and I really need the ID to...
2
by: Dave | last post by:
I cannot insert into my appointments table because the primary key and identity column, appt_id, cannot be added. What do I have to change in my SQL statement to add new records into this table? I'm...
6
by: Tony Stoker | last post by:
I have a .Net web app that adds a record to a SQL database. After the user adds their record I want to have a link that will link them to their new record! The recordID is a AutoNumber in the...
4
by: brent.ryan | last post by:
How do I get the next int value for a column before I do an insert in MY SQL Server 2000? I'm currently using Oracle sequence and doing something like: select seq.nextval from dual; Then I...
6
by: Hardy Wang | last post by:
Hi all, I have the following codes, but SCOPE_IDENTITY() just returns NULL to me. If I comment out SCOPE_IDENTITY() line and run @@IDENTITY line, it works fine!! Since I have a trigger on the...
13
by: bevanward | last post by:
Hi All I am finding unexpected results when inserted into a newly created table that has a field of datatype int identity (1,1). Basically the order I sort on when inserting into the table is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.