Script All Object Permissions
Quick and dirty script to generate the required SQL to reinstate permissions on each user object. This can be saved off for DR purposes.
2002-09-24
458 reads
Quick and dirty script to generate the required SQL to reinstate permissions on each user object. This can be saved off for DR purposes.
2002-09-24
458 reads
Every want an easy way to set all database to DBO only and single user mode? Well here is a script to do that for you. This script is useful when you want to keep users out of the all the databases.
2002-09-23
1,328 reads
Here is a companion script to "Set All databases to DBO only and Single User Mode" that will turn off dbo and single user mode for all databases.
2002-09-23
519 reads
for both 7.0 and 2000. It generates log table and triggers for main table.Its avaliable for all dbs on current server.
2002-09-21
686 reads
Others have asked for this throught the disussion threads so I thought others might benefit as well.This SQL-DMO script will create multiple files for server logins (SIDs & encrypted passwords), database users, tables, procedures and views.1. Alter the script to reflect your server and path for output files.2. Create the job (ActiveX Script).Be great!Michael
2002-09-20
1,209 reads
Recently at my site we had a need to gather current capcatiy of all databases as well as table obejcts on our servers. although there are some out of the box stored proceudres to assist in this effort as well as some schema objects, they mostly would return information on one database at a time. […]
2002-09-20
285 reads
This DTS package reads a list of servers from an XML configuration file, connects to each server, and writes a list of all failed jobs to a web page on the web server. Each morning, I just need to open my browser and I can see the status of all 42 of our servers.
2002-09-19
695 reads
We utilize this to script our jobs on a scheduled basis. The main advantage is that it is automated and really comes in handy when there is a large number of jobs.1. Create a job; ActiveX Script.2. Paste the code; change the server/path to your desired values.
2002-09-19
906 reads
This one is For SQL 2000.This SP enable,disable or list all the Triggers in the given database.If enable or disable are specified, finds all the triggers of all the tablesand enable or disable them, After that, it list all the triggers with it´s current state.If List is specified, then it only list the triggers with […]
2002-09-19
698 reads
It is a very simple but useful SP to get Trigger and related table info especially on databases having large number of tables.
2002-09-19
343 reads
If you’ve been watching AI roll through the data community and thinking, “this seems...
By Arun Sirpal
Not every production incident is a database in RECOVERY_PENDING or a corrupted event (like...
It is Friday, the queries are running, and nobody is watching the bill. That...
Comments posted to this topic are about the item SQL Art, Part 4: Happy...
WhatsApp: 0817839777 Kw. Industri Pulogadung, Jl. Raya Bekasi Km. 21, Ruko No.A2/18-19, RW.3, Wil,...
WhatsApp: 0817839777 Jl. I Gusti Ngurah Rai No.8 A-B, RT.8/RW.6, Wil, Kec. Duren Sawit,...
I set up a few users on my SQL Server 2022 instance.
CREATE LOGIN User1 WITH PASSWORD = 'Demo12#1' CREATE USER User1 FOR LOGIN User1 GO CREATE LOGIN User2 WITH PASSWORD = 'Demo12#2' CREATE USER User2 FOR LOGIN User2 GO CREATE LOGIN User3 WITH PASSWORD = 'Demo12#3' CREATE USER User3 FOR LOGIN User3 GOI then created a schema that one of them owned. Under this schema, I added a table with some data.
CREATE SCHEMA MySchema AUTHORIZATION User1
GO
CREATE TABLE Myschema.MyTable(myid INT)
GO
INSERT MySchema.MyTable
(
myid
)
VALUES
(1), (2), (3)
GO
SELECT * FROM MySchema.MyTable
GO
I granted rights and verified that User2 could access this table.
GRANT SELECT ON Myschema.MyTable TO User2 GO SETUSER 'USER2' GO SELECT * FROM MySchema.MyTable GOThis worked. Now, I move this schema to a new user.
ALTER AUTHORIZATION ON SCHEMA::Myschema TO User3; GOWhat happens with this code?
SETUSER 'USER2' GO SELECT * FROM MySchema.MyTable GOSee possible answers