Update sql table from excel - sql

I need users to insert excel data into a sql table on a continuous basis.
They are not sql users, they are barely excel users.
The sprreatsheet is simple, 5 columns, less than 500 rows at a time and all into a single sql table.
In a perfect world they open and update excel and in one or two clicks get a message that says Success.
I am open to any approach.
I have used the import wizard with success, i can write vba code and some sql.
What I don't know how to do is to get a user to inseert excel into a sql table without risking the entire database to complete distruction.
stay well,
michael

you should build a small interface program that the users would update. You can then control it all you want, and update the database as desired, based on their input. Add a single "SAVE" button to save their input.

Related

How to automate SQL query to get row count of all tables

We need to automate the SQL row count, as of now we are using an Excel formula to fill count(*) query to all tables and copying it and pasting in Oracle SQL Developer and running all at once.
So, what I am looking for: is there any way to get automated by using Python or any programming language which directly connects to a database by asking necessary inputs and get all the process done by itself and get me row count for each table without involving me or any process said above.

Best practice for data migration

Currently We have developed a system for a manual work they have been doing using many excel files.
Is there a best practice for data migration? because I wanted to use backend language like .net to do the validation and insert into tables rather than using SQL to do migration.
Total record in excel is around 12K rows but for many tables so its not needed consider a lot about performance and it is only one time.
I would add a few calculated columns in Excel that would generate SQL Insert / Update scripts. Something like ="INSERT INTO table (column) VALUES ('"&A1&"');"
Then just copy calculated column and run it through SQL client. I used to have a macros to run it directly from Excel through OLEDB that would highlight failed expressions and store SQL Exceptions next to them.
That way the data can be easily tidied, corrected and SQL re-run as needed.

Access update table that is being used by a maketable query

I have a form in access that I have embedded a query on.
The query was made using the make query wizard.
The values of the linked table need to change to reflect changes to the underlying data.
It seems ridiculous that this table is now locked from editing.
Is there away around this?
Cheers
D

Join Excel spreadsheet to a SQL database

I often get requests that look something like this:
"Hey, can you reconcile this Excel spreadsheet with our database and
fill in the additional info for the ones you find? We also need to know
which ones are missing."
ID Name Client AdditionalInfo
------------------------------------------
234 John Client1
147 Mike Client2
546 Mary Client3
...
(Several hundred or thousand more rows)
Is there some way to take an Excel spreadsheet like that and join it to a SQL database within SQL Server Management Studio? I usually copy the ID to make a massive IN list, which is obviously far from ideal. Then I still have the task of lining up the data if I don't get a 1:1 match for every row.
I'm using SQL Server 2005 and Excel 2010.
I've tried to add an Excel spreadsheet as a linked server but querying it warned me that 'Ad Hoc Distributed Queries' are blocked and must be enabled. I'm not sure what negative implications enabling that may have, so I didn't go any further down that route.
My next thought was to use Excel formulas to make a SELECT [Col_A], [Col_B], [Col_C] UNION ALL for every single row in Excel, then copy that to SSMS to make a temp table I could join... but that still seems like a fairly messy and inefficient hack
You could import your Excel spreadsheet into a table in your database created specifically for that reason. In SSMS, right-click your database, go to Tasks->Import Data and choose Excel as your Data Source.
Excel can connect to Sql Server directly. Specifically, you want to use MS Query. This will allow you to join your Excel worksheet directly against a database using SQL.

MS Access form not displaying data from the tables

I'm building a new Access 2007 database with a large number of tables. Designed a form with multiple tabs to display the fields from various tables, which all have a relationship with each other. When new data is entered it is all being saved correctly to the various tables. However, when the form is opened it is not displaying any of the data stored in the tables. The form properties seem to be set correctly, it allows additions and editing and is not set for data entry only. Running the query that is the recordsource fails to return any records, which looks like the problem lies there, and yet the recordsource must be correct if it is able to save the new data entered to the right tables. Any ideas on what the problem might be?
Check you database connection If database connection is established correctly then you need to check you database query e.g if you are writing this query
Select * from tableName
Just copy it and run in access sql query editor if that work fine it means some thing is wrong in you form data retrrvil mechanism.
Hope it helps you