473,503 Members | 1,670 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using SQL server to process the data

SQL Server 2000 sp3; single instance; used as backend to Access 2002:

I have 20 tables used as a temporary store, each one receiving data
from VB based remote applications that insert new data on a regular
basis.

My current Access apps are used to collate, action and summarise this
data.

The collation process involves checking the new data and adding it to
a single table, and if action is required flag this - this is done in
the "server" Access app. The other Access apps are used to filter and
view the data, reports etc.

Question:
is it possible to do this collation in SQL Server by some automated
task triggered by an event, thereby speeding things up and releiving
the need to be logged on with the "server" Access app ?

The function outline for each of the 20 tables would be:
1. Are there any new records, if so insert them into the central table
2. If the status field=1 of any these new records copy these records
to a 2nd table
3. Repeat
regards,

B Moor
Jul 20 '05 #1
3 1330
B Moor (mo******@yahoo.co.uk) writes:
Question:
is it possible to do this collation in SQL Server by some automated
task triggered by an event, thereby speeding things up and releiving
the need to be logged on with the "server" Access app ?

The function outline for each of the 20 tables would be:
1. Are there any new records, if so insert them into the central table
2. If the status field=1 of any these new records copy these records
to a 2nd table
3. Repeat


Yes, you should be able to write a stored procedure for this.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2
Erland Sommarskog <es****@sommarskog.se> wrote in message news:<Xn**********************@127.0.0.1>...
B Moor (mo******@yahoo.co.uk) writes:
Question:
is it possible to do this collation in SQL Server by some automated
task triggered by an event, thereby speeding things up and releiving
the need to be logged on with the "server" Access app ?

The function outline for each of the 20 tables would be:
1. Are there any new records, if so insert them into the central table
2. If the status field=1 of any these new records copy these records
to a 2nd table
3. Repeat


Yes, you should be able to write a stored procedure for this.


Erland,

I have so far used stored procedures for insert,update & deletes and I
have just read that triggers can be used but that caution should be
taken when using them, although I think in my application they look
right for the task.

Are you referring to Triggers or a different method using stored
procedures, and if the latter can you give me a simple example of what
you mean ?
[I have copied an extract from another of your posts below which seems
to be closely related ?

<extract from another post>
There a few things you can do to optimize a trigger. If your
operations
on a table mainly are one-row operations, consider writing logic like:

SELECT @rowc = COUNT(*) FROM inserted
IF @rowc = 0
RETURN

IF @rowc = 1
BEGIN
SELECT @val1 = col1, @val2 = col2 FROM inserted
-- Use variables for real job.
END
ELSE
BEGIN
-- Multi-row operation using inserted.
END

You can also consider saying SELECT * INTO #inserted FROM inserted,
and
then use that temp table. Then you are at least scanning inserted only
once. This is something you should not do 6.5, because you will block
others from creating a temp table while the trigger is running.

</extract from another post>
Jul 20 '05 #3
B Moor (mo******@yahoo.co.uk) writes:
Erland Sommarskog <es****@sommarskog.se> wrote in message news:<Xn**********************@127.0.0.1>...
B Moor (mo******@yahoo.co.uk) writes:
> Question:
> is it possible to do this collation in SQL Server by some automated
> task triggered by an event, thereby speeding things up and releiving
> the need to be logged on with the "server" Access app ?
>
> The function outline for each of the 20 tables would be:
> 1. Are there any new records, if so insert them into the central table
> 2. If the status field=1 of any these new records copy these records
> to a 2nd table
> 3. Repeat


Yes, you should be able to write a stored procedure for this.


Erland,

I have so far used stored procedures for insert,update & deletes and I
have just read that triggers can be used but that caution should be
taken when using them, although I think in my application they look
right for the task.

Are you referring to Triggers or a different method using stored
procedures, and if the latter can you give me a simple example of what
you mean ?


My answer was brief because I did not really a get a full understanding
of what you wanted to do. But it seemed that you could use stored procedures
for whatever the task was. If you plan to compile from various tables
as are are inserted, it is possible that you can use triggers as well.

It could help if you provided a more detailed example. Also then keep
in mind that not everyknow here knows Access. For instance, I don't.
[I have copied an extract from another of your posts below which seems
to be closely related ?
Sometimes thing you say are not always good advice:
You can also consider saying SELECT * INTO #inserted FROM inserted,
and then use that temp table. Then you are at least scanning inserted only
once. This is something you should not do 6.5, because you will block
others from creating a temp table while the trigger is running.


I have since found that this is not very good idea. It's better to
declare a table variable and insert inserted/deleted into that table
variable. You would only include the columns you actually need in
the table variable.

How bad SELECT INTO actually is, depends on how access the tables. I
had a case in our application where we were doing one-by-one processing
in a long transaction and a trigger with a SELECT INTO was fired many
times. With 470 reads each time only to create the table, this proved
to be expensive.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #4

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

Similar topics

121
9905
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
6
17139
by: ransoma22 | last post by:
I developing an application that receive SMS from a connected GSM handphone, e.g Siemens M55, Nokia 6230,etc through the data cable. The application(VB.NET) will receive the SMS automatically,...
21
34322
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
221
366956
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
2
2358
by: Mr. Arnold | last post by:
I mean the ability to call a Web service or a WCF service with Service Broker using CLR code that's running on SQL server is very good. I am programming this in a project for a client that's being...
0
7201
marktang
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,...
0
7328
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...
0
5578
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,...
1
5011
isladogs
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...
0
4672
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...
0
3166
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1510
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 ...
0
379
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.