473,769 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Copy Row Of Data From Table to Table In Same DB

Hi.

Like the title says - how do i do this?

I was given the following example:

INSERT INTO TABLE2 SELECT * FROM TABLE1 WHERE COL1 = 'A'

The above statement threw the following error:

An explicit value for the identity column in table 'TABLE2' can only
be specified when a column list is used and IDENTITY_INSERT is ON.

Then, after filling in all the column names in my above select
statement I kept getting an error to the effect that the number of
source and destination columns don't match. This is because one column
"confirm_ha sh" does not exist in the destination table, just the
source table.

could somebody show me how to get this to work?

thanks!

PS - MS SQL SERVER EXPRESS 2005

Jun 4 '07 #1
10 17942
The syntax to use INSERT INTO is like this:

INSERT INTO TABLE2
(<column_list> )
SELECT <column_list>
FROM TABLE1
WHERE COL1 = 'A'

A few brief notes:
- the <column_listwil l list your columns (like COL1, COL2, COL3, etc.)
- the <column_listmus t contain the same number of columns in both clauses
(INSERT INTO and SELECT)
- if you do not specify the <column_listi n the INSERT INTO clause (as you
did in your sample query), then the <column_listi n SELECT must much all
columns in TABLE2
- the columns have to be of the same data type and size, being able to
implicitly convert, or explicitly converted via CAST/CONVERT
- in your case if the "confirm_ha sh" column does not exists in the
destination table, then you have to drop it from the column list (or alter
TABLE2 before the insert to add the column)
- you do not have to list the IDENTITY column as it will get automatically
the value based on the IDENTITY (of if you want to force a value in that
column, run before the query SET IDENTITY_INSERT TABLE2 ON)

If you post your CREATE TABLE statements for both tables, some sample data
and desired results you can get much better help.

HTH,

Plamen Ratchev
http://www.SQLStudio.com

Jun 4 '07 #2
On Jun 4, 1:54 pm, "Plamen Ratchev" <Pla...@SQLStud io.comwrote:
The syntax to use INSERT INTO is like this:

INSERT INTO TABLE2
(<column_list> )
SELECT <column_list>
FROM TABLE1
WHERE COL1 = 'A'

A few brief notes:
- the <column_listwil l list your columns (like COL1, COL2, COL3, etc.)
- the <column_listmus t contain the same number of columns in both clauses
(INSERT INTO and SELECT)
- if you do not specify the <column_listi n the INSERT INTO clause (as you
did in your sample query), then the <column_listi n SELECT must much all
columns in TABLE2
- the columns have to be of the same data type and size, being able to
implicitly convert, or explicitly converted via CAST/CONVERT
- in your case if the "confirm_ha sh" column does not exists in the
destination table, then you have to drop it from the column list (or alter
TABLE2 before the insert to add the column)
- you do not have to list the IDENTITY column as it will get automatically
the value based on the IDENTITY (of if you want to force a value in that
column, run before the query SET IDENTITY_INSERT TABLE2 ON)

If you post your CREATE TABLE statements for both tables, some sample data
and desired results you can get much better help.

HTH,

Plamen Ratchevhttp://www.SQLStudio.c om

Thanks Plamen,

I have followed your directions and that works (tested in QA).
Since the query is now getting kind of detailed, I have decided to
create a stored procedure out of this. I am getting an error:

Msg 102, Level 15, State 1, Procedure sp_MyStoredProc edure, Line 75
Incorrect syntax near ','.

Would you mind telling me why I am getting this error (and checking my
SPROC in general)? One note - I have added a final column (column18)
in my sproc that exists in Table2, but not in Table1.

Thanks, I really appreciate any feedback you can provide.

Peter

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFI ER ON
GO

-- =============== =============== ===============
-- Author: <Author: Last, First>
-- Create date: <Create Date: 4 June 2007>
-- Description: <Description: Table To Table Copy>
-- =============== =============== ===============

CREATE PROCEDURE sp_MyStoredProc edure

@column1 DATETIME = NULL,
@column2 VARCHAR(50) = NULL,
@column3 VARCHAR(50) = NULL,
@column4 VARCHAR(50) = NULL,
@column5 VARCHAR(50) = NULL,
@column6 INT = NULL,
@column7 VARCHAR(50) = NULL,
@column8 VARCHAR(50) = NULL,
@column9 INT = NULL,
@column10 INT = NULL,
@column11 INT = NULL,
@column12 VARCHAR(50) = NULL,
@column13 VARCHAR(50) = NULL,
@column14 VARCHAR(50) = NULL,
@column15 VARCHAR(50) = NULL,
@column16 VARCHAR(50) = NULL,
@column17 VARCHAR(50) = NULL,
@column18 VARCHAR(50) = NULL

AS
BEGIN

-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

INSERT INTO Table1
(column1,
column2,
column3,
column4,
column5,
column6,
column7,
column8,
column9,
column10,
column11,
column12,
column13,
column14,
column15,
column16,
column17)
SELECT column1,
column2,
column3,
column4,
column5,
column6,
column7,
column8,
column9,
column10,
column11,
column12,
column13,
column14,
column15,
column16,
column17
FROM Table2 t2
WHERE t2.column1 = @column1,
column2 = @column2,
column3 = @column3,
column4 = @column4,
column5 = @column5,
column6 = @column6,
column7 = @column7,
column8 = @column8,
column9 = @column9,
column10 = @column10,
column11 = @column11,
column12 = @column12,
column13 = @column13,
column14 = @column14,
column15 = @column15,
column16 = @column16,
column17 = @column17,
column18 = @column18

END
GO

Jun 4 '07 #3
The syntax error is because of the commas in the WHERE clause. The
conditions in the WHERE clause are logical expressions and you have to use
AND or OR between expressions based on what you need to filter. A trimmed
down example is:

INSERT INTO Table1
(column1,
column2)
SELECT column1,
column2
FROM Table2
WHERE column1 = @column1
AND column2 = @column2

All that said, I am a bit puzzled why you decided to write this stored
procedure and the purpose of passing those column parameters. If you just
need to copy the Table2 to Table1, then directly run the statement like
this:

INSERT INTO Table1
(column1,
column2,
-- ... the rest of the columns go here
column17)
SELECT column1,
column2,
-- ... the rest of the columns go here
column17
FROM Table2

And then if you have any filters that you need to apply to the columns from
Table2, you can add the WHERE clause. Also, you could wrap that statement in
a stored procedure, but I just do not see the purpose of passing all those
column parameters to the SP. Can you explain why you added them and how you
plan to execute the SP, and maybe an example of what parameters you pass?

If you are trying to perform something like dynamic searching (that is
filter on multiple variable conditions), then you may want to read Erland
Sommarskog's article on dynamic search conditions:
http://www.sommarskog.se/dyn-search.html

HTH,

Plamen Ratchev
http://www.SQLStudio.com
Jun 4 '07 #4
On Jun 4, 3:21 pm, "Plamen Ratchev" <Pla...@SQLStud io.comwrote:
The syntax error is because of the commas in the WHERE clause. The
conditions in the WHERE clause are logical expressions and you have to use
AND or OR between expressions based on what you need to filter. A trimmed
down example is:

INSERT INTO Table1
(column1,
column2)
SELECT column1,
column2
FROM Table2
WHERE column1 = @column1
AND column2 = @column2

All that said, I am a bit puzzled why you decided to write this stored
procedure and the purpose of passing those column parameters. If you just
need to copy the Table2 to Table1, then directly run the statement like
this:

INSERT INTO Table1
(column1,
column2,
-- ... the rest of the columns go here
column17)
SELECT column1,
column2,
-- ... the rest of the columns go here
column17
FROM Table2

And then if you have any filters that you need to apply to the columns from
Table2, you can add the WHERE clause. Also, you could wrap that statement in
a stored procedure, but I just do not see the purpose of passing all those
column parameters to the SP. Can you explain why you added them and how you
plan to execute the SP, and maybe an example of what parameters you pass?

If you are trying to perform something like dynamic searching (that is
filter on multiple variable conditions), then you may want to read Erland
Sommarskog's article on dynamic search conditions:http://www.sommarskog.se/dyn-search.html

HTH,

Plamen Ratchevhttp://www.SQLStudio.c om

Hi Plamen,

Thanks - you have been a ton of help.

OK, the situation is that I have a page that is a "click-back" from
a registration page. The user finds the code in his inbox and pastes
it in his http:// box for registration confirmation - you know the
deal.
Once that happens, the code I have been writing moves the data
the user input for registration from a temp table to the official
registered
users table. This is what we have been discussing in this thread.
So, all the values are registration values (reg date, firstName,
lastName,
city, state, zip code, security question, security answer, etc). There
is no identity column in common because the userID identity column
in the destination table will automatically increment upon insertion.

As for the SPROC decision, I decided to use a SPROC because of the
the size of the SQL statement - i thought it was a bit lengthly and
involved
so, i figured it turn it into a SPROC. I am guessing this is a poor
reason
to create a SPROC... maybe you could tell me when is the best time to
use them? I am kind of learning as I go.

Anyway, below is the original statement (inside the SqlConnection
statement). It works when I run it in SQL Express. Let me know if you
think it is more forgiving to do it this way.

Thanks again for your help.

MyConn As New
SqlConnection(C onfigurationMan ager.Connection Strings("myConn Str").Connectio nString)
Dim MyCmd As New SqlCommand("INS ERT INTO Users (regdate, pass, role,
squestion, sanswer, zcode, altemail, email, bdaymonth, bdayday,
bdayyear, gender, sitename, city, state, country, lastName, firstName)
SELECT regdate, pass, role, squestion, sanswer, zcode, altemail,
email, bdaymonth, bdayday, bdayyear, gender, sitename, city, state,
country, lastName, firstName FROM TempRegistratio n t WHERE t.confirm
= '8c37a0737eegd6 4532rgdf56g5ec3 f75aab5d9e7a712 077'", MyConn)

Jun 5 '07 #5
Ok, now it is more clear what you are trying to do... :)

Yes, stored procedure is best here, as it can reuse previously cached
execution plan. Perhaps something like this:

CREATE PROCEDURE ConfirmUserRegi stration
@confirmation_c d NVARCHAR(50)
AS

SET NOCOUNT ON;

BEGIN TRY

BEGIN TRAN

INSERT INTO Users
(egdate,
pass,
role,
squestion,
sanswer,
zcode,
altemail,
email,
bdaymonth,
bdayday,
bdayyear,
gender,
sitename,
city,
state,
country,
lastName,
firstName)
SELECT regdate,
pass,
role,
squestion,
sanswer,
zcode,
altemail,
email,
bdaymonth,
bdayday,
bdayyear,
gender,
sitename,
city,
state,
country,
lastName,
firstName
FROM TempRegistratio n
WHERE confirm = @confirmation_c d;

COMMIT TRAN;

END TRY
BEGIN CATCH

IF (XACT_STATE()) = -1
BEGIN
ROLLBACK TRAN;
END
ELSE IF (XACT_STATE()) = 1
BEGIN
COMMIT TRAN;
END

DECLARE
@ErrorMessage NVARCHAR(4000),
@ErrorSeverity INT,
@ErrorState INT,
@ErrorNumber INT,
@ErrorLine INT,
@ErrorProcedure NVARCHAR(200),
@ErrMessage NVARCHAR(4000);

SELECT
@ErrorMessage = ERROR_MESSAGE() ,
@ErrorSeverity = ERROR_SEVERITY( ),
@ErrorState = ERROR_STATE(),
@ErrorNumber = ERROR_NUMBER(),
@ErrorLine = ERROR_LINE(),
@ErrorProcedure = COALESCE(ERROR_ PROCEDURE(), '-');

SET @ErrMessage = N'Error %d, Level %d, State %d, Procedure %s, Line %d, '
+
N'Message: '+ ERROR_MESSAGE() ;

RAISERROR(
@ErrMessage,
@ErrorSeverity,
1,
@ErrorNumber,
@ErrorSeverity,
@ErrorState,
@ErrorProcedure ,
@ErrorLine
);

END CATCH;

GO

Then in your code call the SP like this (I just typed here, please check for
syntax, I've been using more C# lately and could be missing something):
Using connection As New
SqlConnection(C onfigurationMan ager.Connection Strings("myConn Str").Connectio nString)

Try
Dim command As SqlCommand = New SqlCommand( _
"ConfirmUserReg istration",
connection)
command.Command Type = CommandType.Sto redProcedure

Dim parameter As SqlParameter = command.Paramet ers.Add( _
"@confirmation_ cd ",
SqlDbType.NVarC har, _
50)
parameter.Value = "8c37a0737eegd6 4532rgdf56g5ec3 f75aab5d9e7a712 077"

command.Connect ion.Open()
command.Execute NonQuery()

Catch exSQL As SqlException
' Log and show error

Catch exGen As Exception
' Log and show error

End Try

End Using

HTH,

Plamen Ratchev
http://www.SQLStudio.com

Jun 5 '07 #6
On Jun 4, 8:15 pm, "Plamen Ratchev" <Pla...@SQLStud io.comwrote:
Ok, now it is more clear what you are trying to do... :)

Yes, stored procedure is best here, as it can reuse previously cached
execution plan. Perhaps something like this:

CREATE PROCEDURE ConfirmUserRegi stration
@confirmation_c d NVARCHAR(50)
AS

SET NOCOUNT ON;

BEGIN TRY

BEGIN TRAN

INSERT INTO Users
(egdate,
pass,
role,
squestion,
sanswer,
zcode,
altemail,
email,
bdaymonth,
bdayday,
bdayyear,
gender,
sitename,
city,
state,
country,
lastName,
firstName)
SELECT regdate,
pass,
role,
squestion,
sanswer,
zcode,
altemail,
email,
bdaymonth,
bdayday,
bdayyear,
gender,
sitename,
city,
state,
country,
lastName,
firstName
FROM TempRegistratio n
WHERE confirm = @confirmation_c d;

COMMIT TRAN;

END TRY
BEGIN CATCH

IF (XACT_STATE()) = -1
BEGIN
ROLLBACK TRAN;
END
ELSE IF (XACT_STATE()) = 1
BEGIN
COMMIT TRAN;
END

DECLARE
@ErrorMessage NVARCHAR(4000),
@ErrorSeverity INT,
@ErrorState INT,
@ErrorNumber INT,
@ErrorLine INT,
@ErrorProcedure NVARCHAR(200),
@ErrMessage NVARCHAR(4000);

SELECT
@ErrorMessage = ERROR_MESSAGE() ,
@ErrorSeverity = ERROR_SEVERITY( ),
@ErrorState = ERROR_STATE(),
@ErrorNumber = ERROR_NUMBER(),
@ErrorLine = ERROR_LINE(),
@ErrorProcedure = COALESCE(ERROR_ PROCEDURE(), '-');

SET @ErrMessage = N'Error %d, Level %d, State %d, Procedure %s, Line %d, '
+
N'Message: '+ ERROR_MESSAGE() ;

RAISERROR(
@ErrMessage,
@ErrorSeverity,
1,
@ErrorNumber,
@ErrorSeverity,
@ErrorState,
@ErrorProcedure ,
@ErrorLine
);

END CATCH;

GO

Then in your code call the SP like this (I just typed here, please check for
syntax, I've been using more C# lately and could be missing something):

Using connection As New
SqlConnection(C onfigurationMan ager.Connection Strings("myConn Str").Connectio nString)

Try
Dim command As SqlCommand = New SqlCommand( _
"ConfirmUserReg istration",
connection)
command.Command Type = CommandType.Sto redProcedure

Dim parameter As SqlParameter = command.Paramet ers.Add( _
"@confirmation_ cd ",
SqlDbType.NVarC har, _
50)
parameter.Value = "8c37a0737eegd6 4532rgdf56g5ec3 f75aab5d9e7a712 077"

command.Connect ion.Open()
command.Execute NonQuery()

Catch exSQL As SqlException
' Log and show error

Catch exGen As Exception
' Log and show error

End Try

End Using

HTH,

Plamen Ratchevhttp://www.SQLStudio.c om

Thanks again Plamen. This thread has been very helpful.

I have a final question. How do I handle cases where the confirmation
code
doesn't exist? Say a user is trying to guess a code - How would the
stored procedure catch a mismatch and return the result to VB.NET so
the appropriate message can be sent to the user?

Thanks again for all your help.
Peter

Jun 5 '07 #7
On Jun 5, 7:17 am, pbd22 <dush...@gmail. comwrote:
On Jun 4, 8:15 pm, "Plamen Ratchev" <Pla...@SQLStud io.comwrote:
Ok, now it is more clear what you are trying to do... :)
Yes, stored procedure is best here, as it can reuse previously cached
execution plan. Perhaps something like this:
CREATE PROCEDURE ConfirmUserRegi stration
@confirmation_c d NVARCHAR(50)
AS
SET NOCOUNT ON;
BEGIN TRY
BEGIN TRAN
INSERT INTO Users
(egdate,
pass,
role,
squestion,
sanswer,
zcode,
altemail,
email,
bdaymonth,
bdayday,
bdayyear,
gender,
sitename,
city,
state,
country,
lastName,
firstName)
SELECT regdate,
pass,
role,
squestion,
sanswer,
zcode,
altemail,
email,
bdaymonth,
bdayday,
bdayyear,
gender,
sitename,
city,
state,
country,
lastName,
firstName
FROM TempRegistratio n
WHERE confirm = @confirmation_c d;
COMMIT TRAN;
END TRY
BEGIN CATCH
IF (XACT_STATE()) = -1
BEGIN
ROLLBACK TRAN;
END
ELSE IF (XACT_STATE()) = 1
BEGIN
COMMIT TRAN;
END
DECLARE
@ErrorMessage NVARCHAR(4000),
@ErrorSeverity INT,
@ErrorState INT,
@ErrorNumber INT,
@ErrorLine INT,
@ErrorProcedure NVARCHAR(200),
@ErrMessage NVARCHAR(4000);
SELECT
@ErrorMessage = ERROR_MESSAGE() ,
@ErrorSeverity = ERROR_SEVERITY( ),
@ErrorState = ERROR_STATE(),
@ErrorNumber = ERROR_NUMBER(),
@ErrorLine = ERROR_LINE(),
@ErrorProcedure = COALESCE(ERROR_ PROCEDURE(), '-');
SET @ErrMessage = N'Error %d, Level %d, State %d, Procedure %s, Line %d, '
+
N'Message: '+ ERROR_MESSAGE() ;
RAISERROR(
@ErrMessage,
@ErrorSeverity,
1,
@ErrorNumber,
@ErrorSeverity,
@ErrorState,
@ErrorProcedure ,
@ErrorLine
);
END CATCH;
GO
Then in your code call the SP like this (I just typed here, please check for
syntax, I've been using more C# lately and could be missing something):
Using connection As New
SqlConnection(C onfigurationMan ager.Connection Strings("myConn Str").Connectio nString)
Try
Dim command As SqlCommand = New SqlCommand( _
"ConfirmUserReg istration",
connection)
command.Command Type = CommandType.Sto redProcedure
Dim parameter As SqlParameter = command.Paramet ers.Add( _
"@confirmation_ cd ",
SqlDbType.NVarC har, _
50)
parameter.Value = "8c37a0737eegd6 4532rgdf56g5ec3 f75aab5d9e7a712 077"
command.Connect ion.Open()
command.Execute NonQuery()
Catch exSQL As SqlException
' Log and show error
Catch exGen As Exception
' Log and show error
End Try
End Using
HTH,
Plamen Ratchevhttp://www.SQLStudio.c om

Thanks again Plamen. This thread has been very helpful.

I have a final question. How do I handle cases where the confirmation
code
doesn't exist? Say a user is trying to guess a code - How would the
stored procedure catch a mismatch and return the result to VB.NET so
the appropriate message can be sent to the user?

Thanks again for all your help.
Peter

Actually, I have a bit of an addition to the above "final
question" :) .
I am also wondering where in the SPROC that you have provided
I could place a confirmation that the insert statement has happened
successfully? Or, how do I include a check within the SPROC to
verify successful insertion? I ask because, once the data has been
successfully moved from the Temp table to the Users table, I will need
to delete the source row in the Temp table. I can figure out how to
code the deletion but am not quite sure how the "onSuccess" statement
looks that indicates that it is OK to go ahead and delete the row.

Thanks again!

Jun 5 '07 #8
I will try to sketch here the answer to both questions:

1). To detect that the confirmation code exists, you can check the number of
rows affected by the insert (using @@rowcount), and then return that value
to the client using an output parameter. If the number of rows is 1 (I
assume you have either a primary key or UNIQUE constraint on the
confirmation code column so duplicates are not possible), then you know you
had a code match, if 0 then there was no match. Here is an abbreviated code
of the SP:

CREATE PROCEDURE ConfirmUserRegi stration
@confirmation_c d NVARCHAR(50),
@numrows INT OUTPUT
AS
-- ....
BEGIN TRAN

INSERT INTO Users
(egdate,
pass,
-- ...
firstName)
SELECT regdate,
pass,
-- ...
firstName
FROM TempRegistratio n
WHERE confirm = @confirmation_c d;

SET @numrows = @@rowcount;

DELETE FROM TempRegistratio n
WHERE confirm = @confirmation_c d;

COMMIT TRAN;

Note that you can directly perform the DELETE without checking the result of
the INSERT, because if there is no match then there will be no rows deleted.
If you want you can have an IF @numrows 0 before executing the DELETE
statement to run it only when there is a match.

2). On your client side, you have to define the output parameter and then
check the results, abbreviated code here:

'... connection, command and first parameter initialization go here
' now add the output parameter
parameter = command.Paramet ers.Add( _
"@numrows",
SqlDbType.Int)
parameter.Direc tion = ParameterDirect ion.Output

'... open the connection and execute command go here
' retrieve the output value
If (command.Parame ters("@numrows" ).Value = 1) Then
' we have a match and confirmation is complete
Else
' confirmation code is invalid - show alert
End If

HTH,

Plamen Ratchev
http://www.SQLStudio.com

Jun 5 '07 #9
On Jun 5, 8:36 am, "Plamen Ratchev" <Pla...@SQLStud io.comwrote:
I will try to sketch here the answer to both questions:

1). To detect that the confirmation code exists, you can check the number of
rows affected by the insert (using @@rowcount), and then return that value
to the client using an output parameter. If the number of rows is 1 (I
assume you have either a primary key or UNIQUE constraint on the
confirmation code column so duplicates are not possible), then you know you
had a code match, if 0 then there was no match. Here is an abbreviated code
of the SP:

CREATE PROCEDURE ConfirmUserRegi stration
@confirmation_c d NVARCHAR(50),
@numrows INT OUTPUT
AS
-- ....
BEGIN TRAN

INSERT INTO Users
(egdate,
pass,
-- ...
firstName)
SELECT regdate,
pass,
-- ...
firstName
FROM TempRegistratio n
WHERE confirm = @confirmation_c d;

SET @numrows = @@rowcount;

DELETE FROM TempRegistratio n
WHERE confirm = @confirmation_c d;

COMMIT TRAN;

Note that you can directly perform the DELETE without checking the result of
the INSERT, because if there is no match then there will be no rows deleted.
If you want you can have an IF @numrows 0 before executing the DELETE
statement to run it only when there is a match.

2). On your client side, you have to define the output parameter and then
check the results, abbreviated code here:

'... connection, command and first parameter initialization go here
' now add the output parameter
parameter = command.Paramet ers.Add( _
"@numrows",
SqlDbType.Int)
parameter.Direc tion = ParameterDirect ion.Output

'... open the connection and execute command go here
' retrieve the output value
If (command.Parame ters("@numrows" ).Value = 1) Then
' we have a match and confirmation is complete
Else
' confirmation code is invalid - show alert
End If

HTH,

Plamen Ratchevhttp://www.SQLStudio.c om

Thanks a ton Plamen,

This thread was immensely helpful. I really appreciate it.
As a final note, for anybody that is using this thread for their own
registration system, you need to comment out NOCOUNT ON to
get the appropriate response from the SPROC (at least, I think
that is what solved my "no response" problem).

Thanks again Plamen!

Jun 5 '07 #10

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

Similar topics

1
8627
by: sbh | last post by:
I need to copy data from a table on one Oracle server to another. Scenario: Need to create a stored procedure in server a, database aa that will copy data from server b, database bb, table bbb to server a, database aa, table aaa. Let's say I have a user on server b, database bb named userB (password pw) that has rights to table bbb. Can anyone help me with the syntax - just for the connection part? Is this possible with a stored...
5
295555
by: Bill | last post by:
I have a table I'd like to copy so I can edit it and play around with the data. How do I create copy of a table in SQl Server? Thanks, Bill
1
3096
by: Steve | last post by:
ive been too busy trying to get my database and forms to work to really concern myself with backing things up or protecting the data in case a user really botches something up. is there anything like archive logging for an access database. for now is there a way I can say copy main-table into main-table-timestamp automatically when the application opens or say when a form is loaded? the database is usable at this time but there are...
1
1420
by: Otto Blomqvist | last post by:
Hello ! I have two tables with identical schema. I want to copy all data from Table A to Table B, but table B might already have some of table A:s data (each record is identified using record_numbers). I would suspect this can be accomlished using a 2 stage query, first performing a join of some kind and then the copying. But I have little to no clue on how to make it happen. Any ideas ?
3
4417
by: colleen1980 | last post by:
Hi: Can any one please help me when user select 2 dates from DDLDate1 10/09/2006 and DDLDate2 10/12/06 and the name and it close the form. I need to create multiple records in the another table on the basis of two dates like that. Data in continous form table1 ----------------------------- Data entered in continous form 10/09/2006 10/12/2006 John
2
1555
by: isa | last post by:
Hello everyone, i want to transfer/copy data from MSDE to SQL Server 2000 and from SQL Server to MSDE, through Stored Procedures , not using a "Replication", kindly tell me how i make a SP for this as both datatbases are connetec through LAN, i mean MSDE on diff machine and SQL Server on other machine i make a new registration and connect with MSDE now how can i write a SP that copy data from table of 1 Database to other table of that...
1
1316
by: romeodionisio | last post by:
How to copy data in table in a different SQL Server?.... Can anyone help me?.. Thanks....
15
17958
by: BaneMajik | last post by:
I am working with an Access 2003 inventory database. When a piece of equipment goes bad we junk it and delete it from the database. We have been copying the record to an excel form for storage just so we have a record of the former piece of equipment. I am trying to make the database more user friendly and keep all of the data in Access so have created another table called JunkedEquipment. I would like to be able to use a command button on a...
1
1850
by: okonita | last post by:
Hi all, I have a need to copy data from one database/schema to a different database schema. Yes, I can use export/import but that is not "elegant". Yes, I can try a redirected Restore from Backup but this method has the irritating requirement of pause, set tablespaces and continue, again much manual intervention. What I am most interested in is this: The two databases are in the same instance/server. I want to be able to copy directly from...
0
1294
by: Bxitty | last post by:
I have a package that works great when I run it from the SQL2000 environment. This job transfers data from SQl2005 table to a mainframe DB2 table. After I migrated the job to SQL2005 and ran it (with'n th SQL2000 desiigner editor) it fails with the message Step Error Source: Microsoft Data Transformation Services (DTS) Data Pump Step Error Description:The number of failing rows exceeds the maximum specified. Step Error code:...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10216
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10049
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9997
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8873
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.