Reading the data is easy, pushing an update to a single field in a specific record is the hard part. Some of you have suggested ways of exporting to CSV, and then importing. That is not what I am looking to do here. What I want is an interactive spreadsheet that retrieves, and then dynamically updates the SQL table record.
I need this to require no user interaction. Then create a temporary table with it and use that to get the info you need and then export that information to your "real" table. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 8 years, 3 months ago. Active 8 years, 3 months ago. Viewed times. Improve this question. What is the difference in the local table?
Thanks guys - there arent any differences between the local copy of the table and the linked sql table apart from the fact one is linked etc. The actual data is stored on an SQL server I was only using access as I find it a little easier to run queries.
The live data is made up of several columns and I am trying to add data into column "A" which is currently empty, all the other columns have data in them. Don't think of them that way or you'll get yourself in trouble in a hurry. Best guess without seeing the query is that the linked table is missing a primary key, meaning either the table you linked from in SQL Server doesn't have one not good but it happens or Access couldn't find it when it created the link.
It is also possible that the "SQL Table" you're linking to isn't an actual table but rather a non-updateable view. Thanks for this - I appreciate what your saying and I know I didnt really want to be updating as I am Im fixing someone elses balls up.
Am I ok to set a primary key on the table in Access to run the query or will this have an adverse effect on the SQL table itself? I do have a demo table to trial it on but thgouth I would ask the question first.
If the keys were exported from the orig table, they should match the records - i don't see any issue with that. It's a separate instance of the data. Worst would be the query updates nothing because the join fails. Still results in the same error, I think the problem as advised in no primary key on the table but Im just wondering what impact it will have setting one?
You can and should assuming you're talking about the linked table. Without it, it cannot be updated. The primary key uniquely identifies a row in a table and Access uses it to perform the update.
It won't have any effect on SQL Server. That could be a lot of database calls if the user is continually changing the sheet. Hi, right now i am not worrying about the update i want insertion code into it that will help me.
Wednesday, January 2, PM. Edited by ryguy72 Thursday, January 3, AM. Thursday, January 3, AM. That being said, can a stored procedure take an array as a parameter? I'm thinking: no. Hi Thank You for your replies, In my current code i would also like to check the condition if there is an update the update would be called else if a new row is inserted insertion would take place. Value Santt. Friday, January 4, AM. Yep Ryan, that's the way to go. It's a bad idea. Best to call from within Excel a stored procedure with a set of Merge clauses.
Can Someone please help me and give me a code that has insertion and updation into it and i will then just change the database name and table name????? Tuesday, January 8, AM. Tuesday, January 8, PM. Hi I have a similar request. How can I add code to excel to do this? Thank you, Jennifer JenniferM. Thursday, March 6, AM.
0コメント