I am struggling a bit with the following. Our forecasting tool generates some 100k of records of forecast information in Access each month. The tool is an Excel - Access combination. I want to upload the data from Access to SQL Server after the forecast is done (for multiple purposes). I tried to look up the most easy way but not sure what to use. ADO seems handy where I could integrate that in an existing macro that cleans up the database. Anybody done this before and has some snippet of code to use?
We use SQL Server Management Studio 2008, but not sure whether that's relevant here.
Thanks in advance,
Michiel
In Access, link via ODBC the tables in SQL Server you wish to upload to.
Then create and run append queries to insert the data in the linked tables.
I suggest using SSIS package which is started by job on sql server side (by shedule or manual). You can create package with the help of sql server import/export wizard. I think this is the best way to import data from access to sql server.
Thanks for the answers. I will try to do the linked table way, but I already had a look to that and it seems that due to the fact that I use citrix server I was not able to link it directly to SQL server via ODBC. So I have to check what's different there. Not familiar with the SSIS package yet but I will definitely look into that if the first option does not seem to work out.
Thanks again guys
Related
I am trying to link a sharepoint list to another using sql server database. The ideal would be for this is to a live link so that when data in the sharepoint list is updated, the data in the sql server database is also updated. The reason that I need to do this is that I have an ASP page which will query the SQL database and display the results on a web page.
Any guidance would be much appreciated
Thanks in advance
SidJ
PS : I have done this in access before using the External Data tab ->
More -> Sharepoint List and then following the steps in the wizard, so
I know it is possible. Just not sure how to recreate this using SQL
Server as the destination for the data.
You can go BCS (Business Connectivity Services) or build something custom using a connector like http://www.bendsoft.com/net-sharepoint-connector/
Here is a small guide on BCS http://zimmergren.net/technical/sp-2010-programmatically-work-with-external-lists-bcs-in-sharepoint-2010
I have a SQL Server 2008 Express edition database and I am inserting data to it via a windows application, using Linq-to-SQL. I know the data exists in database because when I query the database I get some data but in SQL Server Management Studio when I right click on a table and click even : 'Edit top 200 rows' or 'Select top 1000 rows' I can not view any data ! any helps ?
Assuming you're using the User Instance and AttachDbFileName= approach - I would argue this approach is severely flawed. Visual Studio will be copying around the .mdf file and most likely, your INSERT works just fine - but you're just looking at the wrong .mdf file in the end!
If you want to stick with this approach, then try putting a breakpoint on the myConnection.Close() call - and then inspect the .mdf file with SQL Server Mgmt Studio Express - I'm almost certain your data is there.
The real solution in my opinion would be to
install SQL Server Express (and you've already done that anyway)
install SQL Server Management Studio Express
create your database in SSMS Express, give it a logical name (e.g. VictoryDatabase)
connect to it using its logical database name (given when you create it on the server) - and don't mess around with physical database files and user instances. In that case, your connection string would be something like:
Data Source=.\\SQLEXPRESS;Database=VictoryDatabase;Integrated Security=True
and everything else is exactly the same as before...
I believe LinqToSql has a "Save" command that actually writes the data to the database. Until that happens you are merely holding it in memory.
ETA: see this question and its answers
I have a problem for create a SQL job, in my local machine I have just .\SQLExpress, but my site stay in a Shared Host, and in this SQL instance I don't see the SQL Agent for create a SQL Job.
Who I do creating a job?
The jobs can actually be scripted in.
Here's an article that might be useful http://www.mssqltips.com/sqlservertip/2161/sql-server-agent-job-management-scripts/
I believe another solution could be to reverse engineer an existing job created through Management Studio by using the IDE to script it out for you. I know you only have SQL Express, so that might not be feasible :-)
SQL Express does not include the SQL Agent. Sorry.
I've had a big problem in replicating a simple SQL Server 2008 R2 Express database for use on a development server. I thought I had it sorted but it turns out that each table has lost it's 'Identity' value somewhere along the line, and it's not possible to add those back in now. This is pretty much useless. So I'm back at square 1; having to get a copy of a MSSQL database plus data from a web server to another web server.
I've read that SQL Server Publishing Wizard does this, and maintains crucial things like identity settings etc. Trouble is, I'm working with SQL Server 2008 R2 Express and I can't actually seem to find a way to access that program anywhere - even though when I go to 'control panel > remove programs' it's in there. When I try to find it on my system (e.g. via start > find programs / files) it's nowhere.
Does anyone know how to access this program, and will it do what I need?
Thanks!
Sure thing, thanks Michael. So the solution was to connect to the database through VWD 2010 Express, which has the options required to do this. There are actually some really great third party tools which do database migrations from one system to another detailed here: http://erikej.blogspot.co.uk/2009/04/sql-compact-3rd-party-tools.html. The ones on this page are geared specifically at SQLCE migrations, but several of the tools also support other full SQL versions too.
I'm trying to create a completely new database from an existing MySQL database, bringing over both data and schema, but so far the only way I've been able to do this is to first import the MySQL database into MS Access, and then into SQL Server 2005? Crazy right? Surely, there is a way that doesn't involve a tedious, custom time-consuming programming, right (perhaps using SSIS)?
A few additions to my original description above:
Its a pretty good size database (easily a few gigs).
I'm working in an MS environment (asp.net, C#)
I'm under a tight deadline so I'm looking for an automated process that requires little to no effort in the conversion process.
SSIS would be the preferred way via BIDS (VS 2005)
Thanks for all the great input!
I believe that using the phpMyAdmin tool you can script the MySQL database structure and data into a sql script. Then you simply run those two scripts on your SQL Server 2005 database and it should, in most cases, create the database and fill it with data. It's been a couple years since I had to do it myself, but as I recall that was the process I used to transfer a MySQL database to SQL Server in the past. You will probably have to alter the structure script to change some of the data types to their SQL Server equivalents, but the data should load just fine once you've got the data types all sorted.
I think you can use SQLYog to generate some fairly standard SQL which will dump out and recreate your db, with data. You may have to massage its output for SQL Server's dialect of SQL a bit, though...
The responses I received were certainly helpful, but the solution it would seem is to do a mysqldump and then run that script from SSIS, massaging the output as needed; however, AFAIK it is not possible to use VS 2005 BIDS to create an SSIS package that completely transfers a MySQL database to a SQL Server 2005 database (data and schema) using Windows Vista 64. I said AFAIK, but who knows the interwebs have much to reveal :)