My database is an Access Data Project, tied to a SQL Server 2005 backend. I'm trying to bind a form to a view that uses an INSTEAD OF trigger. Access thinks the view isn't updatable, so it's making the form read-only; apparently it doesn't take the trigger into account.
I suspect the problem is that SQL Server's metadata says the view isn't updateable. Querying INFORMATION_SCHEMA.VIEWS, for example, shows IS_UPDATABLE = NO. Despite that, I definitely can update the view by using UPDATE statements or using the SSMS GUI.
Is anyone aware of a method I can use to convince Access that this view really is updatable? I know there are other ways I could get read-write access to this form, but I was planning to use this view to limit certain users' access to a very specific subset of data, and it would make things a lot easier if I could encapsulate all of that data within this one view.
Access requires a PK on the linked table in order for it to be updateable - I think this is so the JET (or whatever the new one is) engine can uniquely identify the row to change.
This means you need to convert this view into an indexed view, which is a whole other can of potentially very complicated worms.
Related
In Snowflake, table views are appearing read-only. We are unable to perform basic excel like actions i.e. add new row / columns in a table OR sort etc. Is it a feature or we are missing out something?
Microsoft PowerApps doesn’t have Snowflake as their available DATA CONNECTORS. May I know the timeframe in which it will be available?
Views are, by definition, read-only (they are basically just a saved SELECT statement). If you want to change the data/columns that they display you need to change the tables that the View references and/or change the View definition.
No idea when PowerApps will have a Snowflake connector. You would need to ask Microsoft and unless it was imminent (or on a published roadmap) I doubt they would tell you
I would like to create a view upon a database which changes on time .
For Example: initially, a view layer is to be created for the database B1_2016 in the next refresh, a new database is created and named as B2_2016. So the view layer is to be pointed to B2_2016. In this way, the view layer should point to the newest database created.How can this be achieved in Teradata
That simply isn't how SQL works.
View definitions are part of a schema, and as such themselves part of a database. They cannot ever depend on "variables" that make the view definition itself dependent upon "different databases at different times".
Allowing such stuff is a near guarantee to make the system they are part of worse than just brittle.
I would like to track changes on views data. I don't think it is possible out of the box with current sql server change tracking. Has anyone come up with a solution to this one?
//edit
I'm synchronizing data between two databases. Synchronization works mostly on views (some tables too), so I need to track changes that are being made on views data (insert/update/delete). The task is not trivial, because some views are just JOINS and others use PIVOT.
No. No, you cannot. I wish you could.
You can track changes with DDL Triggers.. Seems like these work on SQL Server version 2005 and above.
One benefit is for users that are just not going to use source control (It happens). This can be a problem if the use GUI view creating and don't want to export to the actual text.
This records the previous versions (you already have the current in the database itself) without any user involvement.
This would free you up from having to be the bottle neck and approve or apply every change.
I didn't read enough of this to see if it would capture the user who submitted the change.
Manage the changes in your source control server and generate your views WITH ENCRYPTION so people don't mess with them on the server.
I'm making a VB.NET application with an SQL Server 2005 in the background. Naturally the user can not edit the database directly but will use a number of UI features to be able to add and modify the data.
However, there are a few tables that should be easily accessible from the admin interface such as specific information about a vendor. What's the easiest way to let the user edit this data freely? One way would be to use a DataGridView but this could appear complicated to the user, plus I'm not sure exactly when to save the edited data back to the database.
The best way that I can think of is to create custom dialog boxes for adding, deleting and changing the information, but this seems like too much work for such a small feature.
You are either going to have to give them the data in a table format (like with the DataGridView) or you are going to need to build something that lets them edit individual records (like custom forms). It seems like a lot of work (and it can be) but there are some ways to cut down on the amount of work.
Check out how to use databinding in VB.NET. There's a tutorial here, another one here and many others out there. You can use databinding for both a table view or for individual records. Using a DataGridView isn't too complicated for a user as long as you build in the necessary support in code - make sure the row is saved if it has been changed and they move to another row (or prompt them), disable editing on columns that they shouldn't be able to change, validate the data before writing it back to the database, etc.
There are also code-generation tools like CodeSmith that can create a data access layer between the GUI and the database. Some of the templates you can get will even generate the actual forms for you.
The only other option I can think of is to give them direct access to the database through tools like SQL Server Management Studio and setting up logins that only have permission to specific tables/views but I would STRONGLY recommend against that.
I have a database that has lots of data and is all "neat", normalized (within reason - using EAV), and I have stored procedures to access and modify the data.
I also have a WinForms application that users download to search and view this data (no inserts). To make things handy for use and updates, I've been using SQLite to store this data and it works really well.
I'm working on updating the entire process and I was wondering if I should use a denormalized view of the data to ship out to the users, ala the 1 table with all the properties as columns, or continue to use the same schema as the master database?
My initial thoughts are along the lines of :
Denormalized View:
Benefits...
Provides a simple method of querying the data (since I'm not doing a lot of joins, just a bunch of column searching.
Cons...
I'd have to manage a second data access layer. Granted I don't think it will be difficult, but it is still a bit more work.
If a new property is added, I'd have to modify the schema again and accomodate for the changes. Wheras I can simply query the property bag and work form there.
Same Schema:
Pros...
Same layout as master database, so updates are minimal, and I can even use the same queries when building my Data Access Layer since SQLite doesn't support stored procedures.
Cons...
There is a lot of small tables for lookup codes and the like, so I could start running into issues when building the queries and managing it in the DAL.
How should I proceed?
If you develop your application to query views of the data rather than the underlying data itself, you will be able to keep the same database for both scenarios without concern or the need to alter your DAL.