Tag Info

New answers tagged

1

Unfortunately that's not that easy because there is no "select any view" privilege (as e.g. Oracle offers). If you can put all views into a single schema, then this could be achieved by granting the select privilege on that schema. Something like this: First you need to create a role that can be used for this create role view_reader; The role only ...


1

Method 1: If you want users to View only, USE <database name here> GO GRANT VIEW Definition TO User1 USE <database name here> GO GRANT VIEW Definition TO User2 and so on for all 5 of them Method 2: If you meant to give them read only access Step 1: In case for domain account users, create a login from windows account with below( for ...


2

As of PostgreSQL 9.4: Different to the documentation of CREATE VIEW, the documentation of CREATE MATERIALIZED VIEW does NOT mention the REPLACE keyword. There seems to be no shortcut aside from dropping all dependent objects and rebuilding each one. When you do so, I can only recommend two small things: Use DROP MATERIALIZED VIEW blabla CASCADE to get a ...


0

Simulation of FULL OUTER JOIN: ( SELECT ... FROM a LEFT JOIN b ON ... ) -- Intersection, plus rest of b UNION ALL -- There will be no overlap; ALL is faster ( SELECT ... FROM b LEFT JOIN a ON ... WHERE a.id IS NULL ) -- Just rest of a (The link given is less efficient because it gets the Intersection twice, then dedups by doing UNION DISTINCT.) If you ...


0

A view and individual SQL logins would be appropriate if each patient accessed the database directly using an ad-hoc query tool, like Access. However, in the case of a front-end application, I suggest performing patient authentication in the app code (perhaps with individual user credentials stored securely in a database) and then just use the patient ...


1

You need to know who the user is and that information needs to be accessible through the view. CREATE VIEW dbo.tPatientForUser AS SELECT patient_id, name, address, gender, loginame FROM tPatient WHERE loginame = SUSER_SNAME(); Or, depending on your application you might need: WHERE loginame = ORIGINAL_LOGIN(); This can help you filter the rows to ...


1

I ended up using a post-initialization script to grant this permission at the subscriber and it worked great.



Top 50 recent answers are included