I have an app that inserts records into a SQL db, I have a file that I'm
reading to get the data out of, aka 'records', how can I determine of the
record has been inserted into the database so i can log that? 3 1609
NuB,
Well, do the records have some sort of unique identifier for them (a
primary key, or combination of fields that indicates that it is unique)? If
so, then you can select the record from the table beforehand. If that
record exists already, then you can log (to wherever you log to) that fact
and not bother inserting the record.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"NuB" <CSharpCoder> wrote in message
news:u8**************@TK2MSFTNGP10.phx.gbl... I have an app that inserts records into a SQL db, I have a file that I'm reading to get the data out of, aka 'records', how can I determine of the record has been inserted into the database so i can log that?
No, i'm just inserting new records from a text file every time the app runs.
So if the insert piece was successfull or not i need to some how get that
value and write it out to a log file.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:eD**************@TK2MSFTNGP15.phx.gbl... NuB,
Well, do the records have some sort of unique identifier for them (a primary key, or combination of fields that indicates that it is unique)? If so, then you can select the record from the table beforehand. If that record exists already, then you can log (to wherever you log to) that fact and not bother inserting the record.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"NuB" <CSharpCoder> wrote in message news:u8**************@TK2MSFTNGP10.phx.gbl...I have an app that inserts records into a SQL db, I have a file that I'm reading to get the data out of, aka 'records', how can I determine of the record has been inserted into the database so i can log that?
NuB,
Well, if you execute your command or your data adapter (whichever you
are using to insert the record) and it executes without exception, then I
would say it succeeded. Also, the command object should be able to tell you
how many records were affected by the statement you executed.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"NuB" <CSharpCoder> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl... No, i'm just inserting new records from a text file every time the app runs. So if the insert piece was successfull or not i need to some how get that value and write it out to a log file.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:eD**************@TK2MSFTNGP15.phx.gbl... NuB,
Well, do the records have some sort of unique identifier for them (a primary key, or combination of fields that indicates that it is unique)? If so, then you can select the record from the table beforehand. If that record exists already, then you can log (to wherever you log to) that fact and not bother inserting the record.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"NuB" <CSharpCoder> wrote in message news:u8**************@TK2MSFTNGP10.phx.gbl...I have an app that inserts records into a SQL db, I have a file that I'm reading to get the data out of, aka 'records', how can I determine of the record has been inserted into the database so i can log that?
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: PT |
last post by:
I got a problem. And thats.....
First of all, I got these three tables.
------------------- ------------------ ----------------------
tblPerson tblPersonSoftware ...
|
by: Thomas Bartkus |
last post by:
The meaning of REPLACE INTO is clear to me.
IF the new record presents new key values, then it is inserted as a new
record.
IF the new record has key values that match a pre-existing record, then...
|
by: george |
last post by:
This is like the bug from hell. It is kind of hard to explain, so
please bear with me.
Background Info: SQL Server 7.0, on an NT box, Active Server pages
with Javascript, using ADO objects.
...
|
by: Philip Boonzaaier |
last post by:
I want to be able to generate SQL statements that will go through a list of
data, effectively row by row, enquire on the database if this exists in the
selected table- If it exists, then the colums...
|
by: Bri |
last post by:
Greetings,
I'm having a very strange problem in an AC97 MDB with ODBC Linked tables
to SQL Server 7. The table has an Identity field and a Timestamp field.
The problem is that when a new record...
|
by: Carl |
last post by:
Hi,
I hope someone can share some of their professional advice and help me out
with my embarissing problem concerning an Access INSERT query. I have never
attempted to create a table with...
|
by: authorking |
last post by:
I use the following code to insert a data record in to a datatable of an
access database.But every time I execute the command, there will rise an
exception and the insert operation can't be...
|
by: Mike Hnatt |
last post by:
My goal is to get data from an XML file into a couple of tables in an Access
database. The XML file is a little complex so I need control over what I do
(I can't just read it into a dataset).
...
|
by: Shapper |
last post by:
Hello,
I have created 3 functions to insert, update and delete an Access
database record. The Insert and the Delete code are working fine.
The update is not. I checked and my database has all...
|
by: MLH |
last post by:
Suppose, in a multi-user environment, you
have append query SQL in a VBA procedure
that looks like INSERT INTO MyTable...
and the next line reads MyVar=DMax("","MyTable...
You can never be...
|
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$) {
}
...
|
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...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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: 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...
|
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,...
|
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,...
| |