473,394 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Transfer records to a SQL SERVER 2005 db

I am new to the site so pardon me if I do things wrong until I learn. Though this question is not specifically to ACCESS it is very near to it so I am posting it hoping I get a reply.

What I want and need to do is update a SQL SERVER 2005 db from an EXCEL 2003 file using VBA. Since I am new to SQL then I am struggling with how to do this. I am well versed in VBA. The db has already been setup and each time run the code runs I will only be sendng new records. So, if anyone has some sample code that let me send about 10 records at a time to a SQL SERVER 200 db from an EXCEL file then please share. This code will run from within the EXCEL file that has the 10 records. This process will occur many times during the day.

If this post needs to go to a better forum or location then please tell me what that is and I will post there and accept my apologies for cluttering this site.

Thanks in advance from a new user.

Bill
Aug 26 '08 #1
3 1952
nico5038
3,080 Expert 2GB
Why use VBA ?
The general approach is to define a DTS (Data transformation service) in MS SQL and use that for the transformation.
When it's a once off job, just right-click the table and use the import feature.
When you need it on a certain frequency you can schedule a job for doing this from MS SQL.

Nic;o)
Aug 27 '08 #2
Because what I am doing is written in VBA and is controlled by VBA. Many users are using my pogram at one time and each user's program will send a batch of records to the db periodically during the day. The db in SQL SERVER is just and only the warehouse for the data. And since I know very little about what SQL can do for me if only SQL were used then I am pursuing the route I have taken. Make sense?
Aug 27 '08 #3
nico5038
3,080 Expert 2GB
As always, there are many roads that lead to a solution here.
One is to use linked tables to both the Excel dataset and the target table in MS SQL, another to start an Access data project (check http://msdn.microsoft.com/library/de...essProject.asp )

As you're obviously in the VBA "department" I guess the linked table approach is best to handle. All needed is to create a mechanism to link the correct excel file and to execute the query to append the excel data to the MS SQL table.

A simple linking mechanism is to use a fixed excel workbook name and have the user file overwritten each time. Problem with this is you'll need to make sure the same data isn't added twice. This can be "solved" by adding / checking a date or runnumber in the userfile.

Nic;o)
Aug 27 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: StephenMcC | last post by:
Hi All, Got a quick query in relation to the Server.Transfer method available in IIS 5+/ASP. I've got an issue where I want to take a portion of an online app and extract this out into a web...
2
by: fhadlaq | last post by:
I need a little help here.. I want to transfer ONLY new records AND update any modified records from Oracle into SQL Server using DTS. How should I go about it? a) how do I use global variable...
2
by: Jeremy | last post by:
I'm having some problems with using Server.Transfer and I am hoping somebody can help me. Page 1 has a datagrid, Page 2 has a form. If a user goes to page 1 and selects something out of the...
3
by: Ken Varn | last post by:
I have Page1 that does a transfer to page2. When the user is done with Page2, there is a button on Page2 that they can press to bring them back to Page1. I use Server.Transfer to navigate from...
3
by: Steve Lutz | last post by:
Hello All, I have an ASPX page whose class inherits from a company global base page. The company base page has a property call PageTitle (string) that is assigned by all the pages. The base...
8
by: bryan | last post by:
I've got a custom HttpHandler to process all requests for a given extension. It gets invoked OK, but if I try to do a Server.Transfer I get an HttpException. A Response.Redirect works, but I really...
9
by: Bob Alston | last post by:
I have been trying to make sure my transfer of data from BE to FE is the lowest possible. I found this info in a web posting by Pat Partman, a MVP, here ...
18
by: B D Jensen | last post by:
Hello! I have an big table with 50Gb data, written som functions that cleanup data and want to do something like this insert into newtable select id, func1(col1), func2(col2) from oldtable; ...
4
by: evantay | last post by:
I'm using ASP.NET 2.0 with VS.NET 2005. I'm trying to access properties from my master pages within a page that inherits from that master page (a child page). However the values are always null....
0
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...
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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,...
0
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
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...
0
tracyyun
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 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.