I have problem with my append query
I have a query Name NewData with exist in a temporary and i have created an Append query name Appenddata. When i run this query i would like the data from temporary table to be inserted into dbo_Master table which reside in MS SQL server. However when i run the appenddata query in is appending zero data into the master table. The master table has several relationships with other tables - need some help on this.
7 1227
I feel sure there was an error message generated of why the data was not appended.
Have you bothered to read it, and if so, what did it say?
Phil
We can't actually tell you what's wrong with the query when you haven't given us the query. You need to post the SQL at least.
Below is my query - INSERT INTO dbo_TblMaster
-
( HRAPSNo, AlphaCode, FirstName, LastName, Branch,
-
Dept, Loc, CostCtr, DateStarted, EndDate, Status,
-
PayRate, AnnualSalary, BirthDate, Sex,
-
MaritalStatus, Dep, PositionNumber, PositionTitle,
-
Netuser, DateCreated, DateModified, [Counter] )
-
SELECT NewData.HRAPSNo, NewData.AlphaCode,
-
NewData.FirstName, NewData.LastName, NewData.Branch, NewData.Dept, NewData.Loc, NewData.CostCtr, NewData.DateStarted, NewData.EndDate, NewData.Status, NewData.PayRate, NewData.AnnualSalary,
-
NewData.BirthDate, NewData.Sex,
-
NewData.MaritalStatus, NewData.Dep,
-
NewData.PositionNumber, NewData.PositionTitle,
-
NewData.Netuser, NewData.DateCreated,
-
NewData.DateModified, NewData.Counter
-
FROM NewData INNER JOIN dbo_TblMaster
-
ON NewData.HRAPSNo = dbo_TblMaster.HRAPSNo;
You should use code tags when posting code to make it easier to read.
But I see the problem in your query. You're joining to table you're trying to insert into. If you're trying to insert new data, then trying to join to the master table is going to return 0 rows.
Thank you Rabbit
I've successfully managed to do remove the inner join and the rows has been picked up when i ran the column, however, I am receiving another error, file conversion error. I will have a workaround with the datatype i guess. Thank you for the assistance.
No problem, feel free to create a new thread if you have another question.
NeoPa 32,556
Expert Mod 16PB
Sometimes linking to the destination table does make sense. Generally when you're trying to add only those records that you know don't exist there already.
In such a case you might use an OUTER JOIN (LEFT JOIN or RIGHT JOIN in Jet/ACE SQL) and include a WHERE clause to include only those records from the destination table where the values are NULL .
Sign in to post your reply or Sign up for a free account.
Similar topics
by: dev |
last post by:
how create a temp table as a copy of a existing table and then update1 field
and insert the hole temp table back in the existing table?
please any help?
if i have 10 fields in 1 record and...
|
by: Tuong Do |
last post by:
Hi,
I am going to insert a large amount (200,000 records) of data into a table
Is there a way that I can temporarily disable the log? so that the insertion
run faster
Thanks in advance
|
by: Raj |
last post by:
Hi,
I am trying to add some more information to the table which already
has a lot a data (like 2-3000 records). The new information may be
adding 2-3 new columns worth. Now my questions are:...
|
by: deko |
last post by:
DoCmd.CopyObject copies data, but I only need structure.
I'm trying to clone several tables in my Access 2003 mdb. The goal is to
link to a series of Excel spreadsheets and then run various...
|
by: Bri |
last post by:
Hi,
First let me explain the process I have going on, then I'll address the
problems I'm having:
1) Insert records in a temp table using a query
2) Using a query that joins the temp table with...
|
by: Carlos |
last post by:
Hello Forum,
I would appreciate it if you could recommend settings to use auto-vacuum in
my version 7.4 database. I am uploading several thousands records in the
database at a rate of ~1 second...
|
by: priyan |
last post by:
hi all,
I am newbie to sql server 2005. I want to import a bulk data from an excel file to the table..........pls suggest me a solution on how to do this................pls reply me as...
|
by: timleonard |
last post by:
I am trying to update some existing database tables by inserting some new fields in a set order within the existing table. The issue I am having is it inserts the new field at the existing position...
|
by: sg2808 |
last post by:
When I am appending new data to an empty existing field in an existing table, the data is being added after the last record (row) in the table.
I would like to place the data in a "side-by-side"...
|
by: sreedharmcts |
last post by:
I have Bulk data ,just want to insert that data from Gridview to Database table how it possible?
I have done this way is it correct?
protected void btn_insert_Click(object sender, EventArgs e)
...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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: 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...
|
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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |