Wednesday, March 28, 2012
Script to reset the "Identity Seed" and "Identity Increment" values
Can any one help me out with the script to reset the "Identity Seed" and "Identity Increment" values for the Identity field.
I can go to enterprise manager and do this or event Generate the script. The script Enterprise manager is creating drops the original table and recreates the table with new defination.
The table can't be droped as it is part of replication.
Is there a work around for this ?
Can I change the "Identity Seed" and "Identity Increment" fields with out droping the table. ?
Any help whould be greatly appreciated.
Thanks,
Prashanth ReddyOriginally posted by Prashanth
hi,
Can any one help me out with the script to reset the "Identity Seed" and "Identity Increment" values for the Identity field.
I can go to enterprise manager and do this or event Generate the script. The script Enterprise manager is creating drops the original table and recreates the table with new defination.
The table can't be droped as it is part of replication.
Is there a work around for this ?
Can I change the "Identity Seed" and "Identity Increment" fields with out droping the table. ?
Any help whould be greatly appreciated.
Thanks,
Prashanth Reddy
You have 2 options that spring to mind:
1. You can use TRUNCATE TABLE to accomplish this, but you will lose all data and as its a non-logged operation nothing will be written to the transaction log. I should add that if the table is referenced by a foriegn key constraint then you will not be able to use this method.
Usage: TRUNCATE TABLE tablename
2. The other option is to use DBCC CHECKIDENT to reset the seed:
Usage: DBCC CHECKIDENT (tablename, RESEED, 0)
macka.|||thanks for the response.|||thanks for the response.
I have patient table with PatientID as auto increment field
with
"Identity Increment" as 1 and
"Identity seed" as 1
I can chane Identity Seed using
DBCC checkident (patient,reseed,4)
How do i change the "Identity Increment" value to 10?
Prashanth|||The following script should work. In this example it resets the seed to 4 and increment to 10.
If the table is referenced by foreign key constraints then you will need to drop them before this script is run and add them back after it completes.
ALTER TABLE Demo
DROP CONSTRAINT PK_Demo
ALTER TABLE Demo
DROP COLUMN DemoID
ALTER TABLE Demo
ADD DemoID INT IDENTITY(4,10)
ALTER TABLE Demo ADD CONSTRAINT
PK_Demo PRIMARY KEY CLUSTERED
(
DemoID
) ON [PRIMARY]
macka.
Tuesday, March 20, 2012
script problem with POWER(x,y)
hi,
i can't see why the following field is not working correctly, ie: it's always coming up with 0:
((POWER((1+((((((POWER((1+(dbo_table1.APR/100)),(1/12)))-1))*12))/12)), dbo_table1.FREQUENCY)-1)*(12/dbo_table1.FREQUENCY))*100 AS YIELD
breaking the code down to a smaller formula it does work.
it looks like i can't have more calculations/references inside a POWER(x,y) function.
any comments would be appreciated.
thank you
The problem is integer math. This formula can never return anything other than zero because (1/12) = 0. Guessing at datatypes:
declare @.apr decimal (4,2)
declare @.frequency decimal(3,0)
set @.apr = 6.5
set @.frequency = 24
select ((POWER((1+((((((POWER((1+(@.apr/100)),(1.0/12.0)))-1))*12))/12)), @.frequency)-1)*(12/@.frequency))*100
This now returns:
6.711700
Hope this helps.
|||thank you very much.
it has solved the issue
regards
Friday, March 9, 2012
Script Component Task: function that returns last word in a string
I have a field called CustomerName Varchar 100 and I wish to write a function that can do the following in a script component task
create a function called CleanString (ByVal CustomerName as String) As String
CleanString Returns the last word of a Customer name if the CustomerName field contains more than one word or if the CustomerName field does not contain Corp or Ltd
ie parse 'Mr John Tools' and the function returns 'Tools'
ie parse 'TechnicalBooks' and the function returns 'TechnicalBooks'
ie parse 'Microsoft Corp' return 'Microsoft Corp'
ie parse 'Digidesign Ltd' return 'Digidesign Ltd'
Any idea of a regular expression or existing piece of existing code I can have
thanks in advance
dave
I believe you'd want something along the lines of:
\s*(\w+(\s+(Corp|Ltd))?)$
Public Function CleanString(ByVal CustomerName As String) As String
Dim re As New Regex("\s*(\w+(\s+(Corp|Ltd))?)$")
Dim m As Match
m = re.Match(CustomerName)
' insert sanity to make sure we had a match
' group 0 would be the full string
' group 1 is the one we want
Dim g As Group = m.Groups(1)
Dim cc As CaptureCollection = g.Captures
CleanString = cc(0).Value
End Function
|||Matt,
Thanks the code almost worked--I had to rewrite it like this. However I need help to tweak the regular expression Regex("\s*(\w+(\s+(Corp|Ltd))?)$") Im getting the following results In/Out
Input: Digidesign Australasia Pty Ltd Output: Pty Ltd --wrong should be Ltd
Input: Ms S Aiten Output: Aiten --correct
Function CleanString(ByVal CustomerName As String) As String
m = re.Match(CustomerName)
' group 0 would be the full string
' group 1 is the one we want
CleanString = m.Groups(1).Value
End Function
'Called by
Public Class ScriptMain
Inherits UserComponent
Dim re As Regex = New Regex("\s*(\w+(\s+(Corp|Ltd))?)$")
Dim m As Match
Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
If Len(Row.CUSTOMERNAME) > 0 Then
Output0Buffer.oCUSTOMERNAME = Row.CUSTOMERNAME.ToString
Output0Buffer.oSearchName = CleanString(Row.CUSTOMERNAME.ToString)
End If
|||I don't think you can easily do this with a single regex. You might want to pre-process the string to remove the Pty first, or have a special case that captures the words you want to the left and right of "Pty" whenever the string appears in your customer name.Wednesday, March 7, 2012
Script
I need a script that it'll changed varchar field to nvarchar a table which i
pass it's name via parameter.
I generated it but it'll raise exception when a field has foreign key etc...
I don't want to spend more time to this work. Do you have a script like
this? Or program?
If you have it could you share with me?
Thanks.
Hi
If you try and change a column's data type and the column is referenced by a
foreign key, or is part of a primary key will give you an error. You will
need to drop these before trying to change the columns datatype. The easiest
way would be to script them, drop them and re-create them afterwards. To drop
them see http://www.mssqlserver.com/scripts/drop_keys.sql
John
"Erencan SADIRODLU" wrote:
> Hi Folks,
> I need a script that it'll changed varchar field to nvarchar a table which i
> pass it's name via parameter.
> I generated it but it'll raise exception when a field has foreign key etc...
> I don't want to spend more time to this work. Do you have a script like
> this? Or program?
> If you have it could you share with me?
> Thanks.
>
>
|||Thanks John, but i want to foreign keys add again after change data type.
This script just drop foreign keys.
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:55E6E65D-A653-4620-A2D3-C4BEB4A224AC@.microsoft.com...[vbcol=seagreen]
> Hi
> If you try and change a column's data type and the column is referenced by
> a
> foreign key, or is part of a primary key will give you an error. You will
> need to drop these before trying to change the columns datatype. The
> easiest
> way would be to script them, drop them and re-create them afterwards. To
> drop
> them see http://www.mssqlserver.com/scripts/drop_keys.sql
> John
> "Erencan SADIRODLU" wrote:
|||Hi
But you could script them first, which is what I indicated in the response.
There are several ways to do this, as this is a one off job use Enterprise
Manager. If you take a backup before making any changes and restore the
database under a different name, you could use a tool such as Red Gate's SQL
Compare to check the differences (in fact you could use this to re-apply the
missing FKs and PKs).
John
"Erencan SADIRODLU" wrote:
> Thanks John, but i want to foreign keys add again after change data type.
> This script just drop foreign keys.
>
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:55E6E65D-A653-4620-A2D3-C4BEB4A224AC@.microsoft.com...
>
>
Saturday, February 25, 2012
Script
I need a script that it'll changed varchar field to nvarchar a table which i
pass it's name via parameter.
I generated it but it'll raise exception when a field has foreign key etc...
I don't want to spend more time to this work. Do you have a script like
this? Or program?
If you have it could you share with me?
Thanks.Hi
If you try and change a column's data type and the column is referenced by a
foreign key, or is part of a primary key will give you an error. You will
need to drop these before trying to change the columns datatype. The easiest
way would be to script them, drop them and re-create them afterwards. To drop
them see http://www.mssqlserver.com/scripts/drop_keys.sql
John
"Erencan SAÃ?IROÃ?LU" wrote:
> Hi Folks,
> I need a script that it'll changed varchar field to nvarchar a table which i
> pass it's name via parameter.
> I generated it but it'll raise exception when a field has foreign key etc...
> I don't want to spend more time to this work. Do you have a script like
> this? Or program?
> If you have it could you share with me?
> Thanks.
>
>|||Thanks John, but i want to foreign keys add again after change data type.
This script just drop foreign keys. :(
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:55E6E65D-A653-4620-A2D3-C4BEB4A224AC@.microsoft.com...
> Hi
> If you try and change a column's data type and the column is referenced by
> a
> foreign key, or is part of a primary key will give you an error. You will
> need to drop these before trying to change the columns datatype. The
> easiest
> way would be to script them, drop them and re-create them afterwards. To
> drop
> them see http://www.mssqlserver.com/scripts/drop_keys.sql
> John
> "Erencan SADIRODLU" wrote:
>> Hi Folks,
>> I need a script that it'll changed varchar field to nvarchar a table
>> which i
>> pass it's name via parameter.
>> I generated it but it'll raise exception when a field has foreign key
>> etc...
>> I don't want to spend more time to this work. Do you have a script like
>> this? Or program?
>> If you have it could you share with me?
>> Thanks.
>>|||Hi
But you could script them first, which is what I indicated in the response.
There are several ways to do this, as this is a one off job use Enterprise
Manager. If you take a backup before making any changes and restore the
database under a different name, you could use a tool such as Red Gate's SQL
Compare to check the differences (in fact you could use this to re-apply the
missing FKs and PKs).
John
"Erencan SAÃ?IROÃ?LU" wrote:
> Thanks John, but i want to foreign keys add again after change data type.
> This script just drop foreign keys. :(
>
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:55E6E65D-A653-4620-A2D3-C4BEB4A224AC@.microsoft.com...
> > Hi
> >
> > If you try and change a column's data type and the column is referenced by
> > a
> > foreign key, or is part of a primary key will give you an error. You will
> > need to drop these before trying to change the columns datatype. The
> > easiest
> > way would be to script them, drop them and re-create them afterwards. To
> > drop
> > them see http://www.mssqlserver.com/scripts/drop_keys.sql
> >
> > John
> >
> > "Erencan SADIRODLU" wrote:
> >
> >> Hi Folks,
> >> I need a script that it'll changed varchar field to nvarchar a table
> >> which i
> >> pass it's name via parameter.
> >> I generated it but it'll raise exception when a field has foreign key
> >> etc...
> >> I don't want to spend more time to this work. Do you have a script like
> >> this? Or program?
> >>
> >> If you have it could you share with me?
> >> Thanks.
> >>
> >>
> >>
>
>
Script
I need a script that it'll changed varchar field to nvarchar a table which i
pass it's name via parameter.
I generated it but it'll raise exception when a field has foreign key etc...
I don't want to spend more time to this work. Do you have a script like
this? Or program?
If you have it could you share with me?
Thanks.Hi
If you try and change a column's data type and the column is referenced by a
foreign key, or is part of a primary key will give you an error. You will
need to drop these before trying to change the columns datatype. The easies
t
way would be to script them, drop them and re-create them afterwards. To dro
p
them see http://www.mssqlserver.com/scripts/drop_keys.sql
John
"Erencan SADIRODLU" wrote:
> Hi Folks,
> I need a script that it'll changed varchar field to nvarchar a table which
i
> pass it's name via parameter.
> I generated it but it'll raise exception when a field has foreign key etc.
.
> I don't want to spend more time to this work. Do you have a script like
> this? Or program?
> If you have it could you share with me?
> Thanks.
>
>|||Thanks John, but i want to foreign keys add again after change data type.
This script just drop foreign keys.
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:55E6E65D-A653-4620-A2D3-C4BEB4A224AC@.microsoft.com...[vbcol=seagreen]
> Hi
> If you try and change a column's data type and the column is referenced by
> a
> foreign key, or is part of a primary key will give you an error. You will
> need to drop these before trying to change the columns datatype. The
> easiest
> way would be to script them, drop them and re-create them afterwards. To
> drop
> them see http://www.mssqlserver.com/scripts/drop_keys.sql
> John
> "Erencan SADIRODLU" wrote:
>|||Hi
But you could script them first, which is what I indicated in the response.
There are several ways to do this, as this is a one off job use Enterprise
Manager. If you take a backup before making any changes and restore the
database under a different name, you could use a tool such as Red Gate's SQL
Compare to check the differences (in fact you could use this to re-apply the
missing FKs and PKs).
John
"Erencan SADIRODLU" wrote:
> Thanks John, but i want to foreign keys add again after change data type.
> This script just drop foreign keys.
>
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:55E6E65D-A653-4620-A2D3-C4BEB4A224AC@.microsoft.com...
>
>
Script
I need a script that it'll changed varchar field to nvarchar a table which i
pass it's name via parameter.
I generated it but it'll raise exception when a field has foreign key etc...
I don't want to spend more time to this work. Do you have a script like
this? Or program?
If you have it could you share with me?
Thanks.
Hi
If you try and change a column's data type and the column is referenced by a
foreign key, or is part of a primary key will give you an error. You will
need to drop these before trying to change the columns datatype. The easiest
way would be to script them, drop them and re-create them afterwards. To drop
them see http://www.mssqlserver.com/scripts/drop_keys.sql
John
"Erencan SADIRODLU" wrote:
> Hi Folks,
> I need a script that it'll changed varchar field to nvarchar a table which i
> pass it's name via parameter.
> I generated it but it'll raise exception when a field has foreign key etc...
> I don't want to spend more time to this work. Do you have a script like
> this? Or program?
> If you have it could you share with me?
> Thanks.
>
>
|||Thanks John, but i want to foreign keys add again after change data type.
This script just drop foreign keys.
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:55E6E65D-A653-4620-A2D3-C4BEB4A224AC@.microsoft.com...[vbcol=seagreen]
> Hi
> If you try and change a column's data type and the column is referenced by
> a
> foreign key, or is part of a primary key will give you an error. You will
> need to drop these before trying to change the columns datatype. The
> easiest
> way would be to script them, drop them and re-create them afterwards. To
> drop
> them see http://www.mssqlserver.com/scripts/drop_keys.sql
> John
> "Erencan SADIRODLU" wrote:
|||Hi
But you could script them first, which is what I indicated in the response.
There are several ways to do this, as this is a one off job use Enterprise
Manager. If you take a backup before making any changes and restore the
database under a different name, you could use a tool such as Red Gate's SQL
Compare to check the differences (in fact you could use this to re-apply the
missing FKs and PKs).
John
"Erencan SADIRODLU" wrote:
> Thanks John, but i want to foreign keys add again after change data type.
> This script just drop foreign keys.
>
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:55E6E65D-A653-4620-A2D3-C4BEB4A224AC@.microsoft.com...
>
>
Script
I need a script that it'll changed varchar field to nvarchar a table which i
pass it's name via parameter.
I generated it but it'll raise exception when a field has foreign key etc...
I don't want to spend more time to this work. Do you have a script like
this? Or program?
If you have it could you share with me?
Thanks.
Hi
If you try and change a column's data type and the column is referenced by a
foreign key, or is part of a primary key will give you an error. You will
need to drop these before trying to change the columns datatype. The easiest
way would be to script them, drop them and re-create them afterwards. To drop
them see http://www.mssqlserver.com/scripts/drop_keys.sql
John
"Erencan SADIRODLU" wrote:
> Hi Folks,
> I need a script that it'll changed varchar field to nvarchar a table which i
> pass it's name via parameter.
> I generated it but it'll raise exception when a field has foreign key etc...
> I don't want to spend more time to this work. Do you have a script like
> this? Or program?
> If you have it could you share with me?
> Thanks.
>
>
|||Thanks John, but i want to foreign keys add again after change data type.
This script just drop foreign keys.
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:55E6E65D-A653-4620-A2D3-C4BEB4A224AC@.microsoft.com...[vbcol=seagreen]
> Hi
> If you try and change a column's data type and the column is referenced by
> a
> foreign key, or is part of a primary key will give you an error. You will
> need to drop these before trying to change the columns datatype. The
> easiest
> way would be to script them, drop them and re-create them afterwards. To
> drop
> them see http://www.mssqlserver.com/scripts/drop_keys.sql
> John
> "Erencan SADIRODLU" wrote:
|||Hi
But you could script them first, which is what I indicated in the response.
There are several ways to do this, as this is a one off job use Enterprise
Manager. If you take a backup before making any changes and restore the
database under a different name, you could use a tool such as Red Gate's SQL
Compare to check the differences (in fact you could use this to re-apply the
missing FKs and PKs).
John
"Erencan SADIRODLU" wrote:
> Thanks John, but i want to foreign keys add again after change data type.
> This script just drop foreign keys.
>
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:55E6E65D-A653-4620-A2D3-C4BEB4A224AC@.microsoft.com...
>
>
Tuesday, February 21, 2012
scope_identity()
an insert query. The entry field is an "identity" and the primary key. I
have used scope_identity() to display the entry# of the record just entered
on the confirmation page. Now I need to insert the entry into another
table. This is my query:
SET NOCOUNT ON
INSERT wo_main
(site_id, customer, po_number)
VALUES ('::site_id::', '::customer::', '::po_number::')
SELECT scope_identity() AS entry
INSERT INTO wo_combo_body
(entry) VALUES ('::entry::')
SET nocount off
This query displays the entry number of the record just entered, but inserts
a 0 in to entry field of the 2nd table. Any help would be great.
Thanks,
Darren>SELECT scope_identity() AS entry
does not assign the identity to a variable named entry, it just
returns a recordset like any other select
either
declare @.Entry int
set @.Entry = (select scope_identity())
insert into table (field) values (@.Entry)
or
insert int table (field) values (select scope_identity())
also move the set nocount off to the top
On Fri, 20 Feb 2004 19:40:54 GMT, "Scrappy"
<celtics@.lan-specialist.com> wrote:
>I have an ASP front end on SQL 2000 database. I have a form that submits to
>an insert query. The entry field is an "identity" and the primary key. I
>have used scope_identity() to display the entry# of the record just entered
>on the confirmation page. Now I need to insert the entry into another
>table. This is my query:
>SET NOCOUNT ON
>INSERT wo_main
> (site_id, customer, po_number)
>VALUES ('::site_id::', '::customer::', '::po_number::')
>SELECT scope_identity() AS entry
>INSERT INTO wo_combo_body
>(entry) VALUES ('::entry::')
>SET nocount off
>This query displays the entry number of the record just entered, but inserts
>a 0 in to entry field of the 2nd table. Any help would be great.
>Thanks,
>Darren|||Hi
If you can use a local variable to hold what is returned by SCOPE_IDENTITY.
This variable can then be used in the second insert statement. You may also
want to add some error checking! Rather than returning a result set it may
also be better(faster) to return the value as a parameter
John
"Scrappy" <celtics@.lan-specialist.com> wrote in message
news:aptZb.32366$um1.10431@.twister.nyroc.rr.com...
> I have an ASP front end on SQL 2000 database. I have a form that submits
to
> an insert query. The entry field is an "identity" and the primary key. I
> have used scope_identity() to display the entry# of the record just
entered
> on the confirmation page. Now I need to insert the entry into another
> table. This is my query:
> SET NOCOUNT ON
> INSERT wo_main
> (site_id, customer, po_number)
> VALUES ('::site_id::', '::customer::', '::po_number::')
> SELECT scope_identity() AS entry
> INSERT INTO wo_combo_body
> (entry) VALUES ('::entry::')
> SET nocount off
> This query displays the entry number of the record just entered, but
inserts
> a 0 in to entry field of the 2nd table. Any help would be great.
> Thanks,
> Darren|||Thanks! I used a trigger to accomplish this. I am new to SQL. Are there
any pitfalls with doing it with a trigger?
Also...
On the same confirmation page I want to diplay links to a page for each
table. Basically I need to select the entry field from each table that I
have inserted to with the trigger. I can then use this as a hyperlink to
the each page. Any ideas on this?
"Bruce Loving" <BRUCE@.LOVINGSCENTS.COM> wrote in message
news:tbtc30lq99c2h3lvjgrh93nt9hmqk1hisc@.4ax.com...
> >SELECT scope_identity() AS entry
> does not assign the identity to a variable named entry, it just
> returns a recordset like any other select
> either
> declare @.Entry int
> set @.Entry = (select scope_identity())
> insert into table (field) values (@.Entry)
> or
> insert int table (field) values (select scope_identity())
> also move the set nocount off to the top
> On Fri, 20 Feb 2004 19:40:54 GMT, "Scrappy"
> <celtics@.lan-specialist.com> wrote:
> >I have an ASP front end on SQL 2000 database. I have a form that submits
to
> >an insert query. The entry field is an "identity" and the primary key.
I
> >have used scope_identity() to display the entry# of the record just
entered
> >on the confirmation page. Now I need to insert the entry into another
> >table. This is my query:
> >SET NOCOUNT ON
> >INSERT wo_main
> > (site_id, customer, po_number)
> >VALUES ('::site_id::', '::customer::', '::po_number::')
> >SELECT scope_identity() AS entry
> >INSERT INTO wo_combo_body
> >(entry) VALUES ('::entry::')
> >SET nocount off
> >This query displays the entry number of the record just entered, but
inserts
> >a 0 in to entry field of the 2nd table. Any help would be great.
> >Thanks,
> >Darren|||Hi
You have very little scope to insert new records in a secondary table if you
use a trigger, as you can not pass parameters to it. If there is only one
column in the second table it should be redundant. If there are other
columns then you should write a stored procedure and use a transaction to
maintain consistency see books online :
BEGIN TRANSACTION:
mk:@.MSITStore:C:\Program%20Files\Microsoft%20SQL%2 0Server\80\Tools\Books\tsq
lref.chm::/ts_ba-bz_96zy.htm
ROLLBACK TRANSACTION:
mk:@.MSITStore:C:\Program%20Files\Microsoft%20SQL%2 0Server\80\Tools\Books\tsq
lref.chm::/ts_ra-rz_471q.htm
COMMIT TRANSACTION:
mk:@.MSITStore:C:\Program%20Files\Microsoft%20SQL%2 0Server\80\Tools\Books\tsq
lref.chm::/ts_ca-co_7w6m.htm
You should be able to identify the values inserted in a session by including
identifying data in the table such as Username, Datatime, SessionId etc.
John
"Scrappy" <celtics@.lan-specialist.com> wrote in message
news:bnxZb.71491$n62.1826@.twister.nyroc.rr.com...
> Thanks! I used a trigger to accomplish this. I am new to SQL. Are there
> any pitfalls with doing it with a trigger?
> Also...
> On the same confirmation page I want to diplay links to a page for each
> table. Basically I need to select the entry field from each table that I
> have inserted to with the trigger. I can then use this as a hyperlink to
> the each page. Any ideas on this?
>
> "Bruce Loving" <BRUCE@.LOVINGSCENTS.COM> wrote in message
> news:tbtc30lq99c2h3lvjgrh93nt9hmqk1hisc@.4ax.com...
> > >SELECT scope_identity() AS entry
> > does not assign the identity to a variable named entry, it just
> > returns a recordset like any other select
> > either
> > declare @.Entry int
> > set @.Entry = (select scope_identity())
> > insert into table (field) values (@.Entry)
> > or
> > insert int table (field) values (select scope_identity())
> > also move the set nocount off to the top
> > On Fri, 20 Feb 2004 19:40:54 GMT, "Scrappy"
> > <celtics@.lan-specialist.com> wrote:
> > >I have an ASP front end on SQL 2000 database. I have a form that
submits
> to
> > >an insert query. The entry field is an "identity" and the primary key.
> I
> > >have used scope_identity() to display the entry# of the record just
> entered
> > >on the confirmation page. Now I need to insert the entry into another
> > >table. This is my query:
> > > >SET NOCOUNT ON
> > >INSERT wo_main
> > > (site_id, customer, po_number)
> > >VALUES ('::site_id::', '::customer::', '::po_number::')
> > >SELECT scope_identity() AS entry
> > >INSERT INTO wo_combo_body
> > >(entry) VALUES ('::entry::')
> > >SET nocount off
> > > >This query displays the entry number of the record just entered, but
> inserts
> > >a 0 in to entry field of the 2nd table. Any help would be great.
> > > >Thanks,
> > >Darren
>