Archive

Archive for the ‘Scripts’ Category

Change \ Transfer Schema for all Objects

December 21st, 2009

In my working environment we will be using different schema for production and development environments. Our development apps are configured to Dev schema and Production apps are configured to Prod schema, so when we restore the db from production to development environment, all our dev apps stopped working since the objects \ securable will be using prod schema. Here I need to change the schema to dev from prod, so the syntax will be like below

Read more…

VN:F [1.8.4_1055]
Rating: 0.0/5 (0 votes cast)
VN:F [1.8.4_1055]
Rating: 0 (from 0 votes)

Vidhya Sagar Scripts, Security ,

Script to Retrieve Security Information – SQL Server 2005 and above

November 11th, 2009

In my working environment I’ve asked to write a script to find security information which should return Server Logins, Database Logins and object level permissions. I’ve written that and I’m sharing this to you since this could be helpful to you.

Read more…

VN:F [1.8.4_1055]
Rating: 4.5/5 (2 votes cast)
VN:F [1.8.4_1055]
Rating: 0 (from 2 votes)

Vidhya Sagar Scripts, Security

Script to Retrieve Security Information – SQL Server 2000

November 11th, 2009

In my working environment I’ve asked to write a script to find security information which should return Server Logins, Database Logins and object level permissions. I’ve written that and I’m sharing this to you since this could be helpful to you.

Read more…

VN:F [1.8.4_1055]
Rating: 5.0/5 (1 vote cast)
VN:F [1.8.4_1055]
Rating: +1 (from 1 vote)

Vidhya Sagar Scripts, Security

Script to find SQL Job activity details

September 17th, 2009

I’ve written a script to find the job activity details, this script will give the output similar to job activity monitor in SQL2K5 or SQL2K8. In my working place we had a request to collect the job details from all the servers which includes all version of SQL Server. I’ve tried sp_help_jobactivity for SQL2K5 \ SQL2k8, however it doesn’t provide the columns needed. So I’ve written a script to get customized output, this script will also work with SQL2K. The script will fetch the following details Read more…

VN:F [1.8.4_1055]
Rating: 5.0/5 (2 votes cast)
VN:F [1.8.4_1055]
Rating: +1 (from 1 vote)

Vidhya Sagar Scripts ,

Script to get row count for all the tables in all the databases

June 13th, 2009

I’ve written this script  to get details of row count in all the tables in all the database including the system database. You can modify the script  to exclude system database if you  don’t need details for that. You can see that I haven’t use COUNT() function to get these values, If I run using this function for all the db then it will take more time and resource.

Read more…

VN:F [1.8.4_1055]
Rating: 4.5/5 (2 votes cast)
VN:F [1.8.4_1055]
Rating: 0 (from 0 votes)

Vidhya Sagar Scripts