Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

A Script A Day - Day 14 - Upgrading to SQL 2012

Today’s script is one I have used to test one possible upgrade method from SQL Server 2008 to SQL Server 2012. If truth be told this would be my prefered upgrade method I’ll explain why…

I have database mirroring in production on SQL Server 2008 two physical servers in an…

Read more

0 comments, 320 reads

Posted in SQL Server 365 on 21 February 2012

A Script A Day - Day 13 - Chris' Top Tip - Batches

Today’s post is pretty cool.  So you have been reading up about something on the World Wide Web or you want to test something that has come to light, you create a table and want to insert a million records.  In the past I imagine some of you have used…

Read more

0 comments, 149 reads

Posted in SQL Server 365 on 21 February 2012

A Script A Day - Day 12 - Granting Role Membership to All Principals


Today's script will grant membership in the db_owner fixed database role in all online read/writable user databases to all principals not in the sysadmin fixed server role.  I have found this script useful when setting up development servers where all developers are given this level of access.  This could however be…

Read more

0 comments, 281 reads

Posted in SQL Server 365 on 20 February 2012

A Script A Day - Day 11 - User Permissions By Database

Today's script will return you permissions granted to a user for every online database.  The script uses EXECUTE AS so you will need permission to impersonate the user and  also uses the fn_my_permissions function so is limited by its functionality.  I have used this script to hunt down what I…

Read more

0 comments, 273 reads

Posted in SQL Server 365 on 20 February 2012

Sorry...

I've been offline for a week to take some annual leave and recharge my batteries.  To make up for the 9 lost days in the A Script A Day series I will be posting multiple scripts each day (starting today) until I have caught up.


Cheers


Chris

Read more

0 comments, 140 reads

Posted in SQL Server 365 on 20 February 2012

A Script A Day - Day 10 - Hosts on vCentre

If you use VMWare for your virtualisation environment all virtual machines are managed by one or more vCentre management servers.  These servers can use a SQL Server database in the back end.  By default the database is called VCDB but could be called anything really.

Todays script assumes that you…

Read more

0 comments, 175 reads

Posted in SQL Server 365 on 10 February 2012

A Script A Day - Day 9 - Index Compression Estimations

Today's script provides amongst other information Index compression estimates based on existing index information.  All you need to do is set the database context and specify a schema, table and compression type.  This script has been useful several times in the past so hopefully you will also find it useful.

Read more

0 comments, 385 reads

Posted in SQL Server 365 on 9 February 2012

A Script A Day - Day 8 - Non Clustered Index Information

Today's script comes to you from London where I am at my head office for my appraisal!  Lets hope it goes well ;)


The below script will provide Index information for all non clustered indexes in a database including the number of records, reserved and used space.  All you need…

Read more

0 comments, 232 reads

Posted in SQL Server 365 on 8 February 2012

A Script A Day - Day 7 - Memory Queries

Today's script is a collection of a few memory queries I've collected from various sources over the years.  These queries are by no means comprehensive but are ones I have certainly used the most.


/*
      -----------------------------------------------------------------
      Memory Queries
      -----------------------------------------------------------------
     
      For more SQL resources, check out SQLServer365.blogspot.com

      -----------------------------------------------------------------

Read more

0 comments, 564 reads

Posted in SQL Server 365 on 7 February 2012

A Script A Day - Day 6 - Drop and Create Database Snapshots

Today's Script will drop all database snapshots and create a database snapshot for all online read writeable user databases. I create this script for use in a database mirroring partnership so that the snapshots could be used on the mirroring partner so to impact the mirroring principal less. As such…

Read more

0 comments, 670 reads

Posted in SQL Server 365 on 6 February 2012

A Script A Day - Day 5 - Database Owner Permissions

Today's script will list all principals with membership in the db_owner fixed database role.


/*
      -----------------------------------------------------------------
      Database Owner Permissions
      -----------------------------------------------------------------
     
      For more SQL resources, check out SQLServer365.blogspot.com

      -----------------------------------------------------------------

      You may alter this code for your own purposes.
      You may republish altered code as long…

Read more

0 comments, 338 reads

Posted in SQL Server 365 on 5 February 2012

A Script A Day - Day 4 - Estimated Time Left

Today's script allows you to keep track of how long left a statement has before it completes.  I find this useful for example when restoring databases.  All you need to do is simply change the der.command  = as required.



/*
      -----------------------------------------------------------------
      Estimated Time to Complete
      -----------------------------------------------------------------
     
     …

Read more

1 comments, 220 reads

Posted in SQL Server 365 on 4 February 2012

A Script A Day - Day 3 - Live Change Data Edit Template

Today's script is a template I use for the occasions when a data edit is required to be run against a live environment.  It has 8 steps to give you as DBA's control over what is being run and the safety of recording results before and after the modifications.  The…

Read more

0 comments, 240 reads

Posted in SQL Server 365 on 3 February 2012

A Script A Day - Day 2 - Database Mail Troubleshooting

Today's script is a collection of simple queries I have saved for a time when I need to troubleshoot database mail problems.



/*
      -------------------------------------
      Summary:                      Database Mail Troubleshooting
      SQL Server Versions:          2005 onwards
      Written by:                   Chris McGowan
      -------------------------------------
     
      For more SQL resources,…

Read more

2 comments, 173 reads

Posted in SQL Server 365 on 2 February 2012

A Script A Day - Day 1 - Database File To Volume Mapping

Today is the 1st February 2012 and as promised here is the first of script in my "A Script A Day" series.  There will be 29 scripts (yes this year is a leap year:) which I will also roll-up into a single document and make available to you some time in…

Read more

1 comments, 277 reads

Posted in SQL Server 365 on 1 February 2012

Database 101

I had an interesting phone call this morning from our professional services team.  They are carrying out what I can only call extreme testing on one of our products to see just how much data we can process in a given time window.  The issue they ran into was a…

Read more

0 comments, 297 reads

Posted in SQL Server 365 on 26 January 2012

Venting Frustration

We as DBA’s face an ever growing list of things to do and services to support.  We work in high pressure environments where time is of the essence and there is little to no room for error.  The very nature of our roles mean we have to work unsociable hours…

Read more

0 comments, 215 reads

Posted in SQL Server 365 on 25 January 2012

A Script a Day

In February I will be starting a series of Blog Posts I'm calling a "A Script a Day".  Each day throughout February I will post a script which I have used in my various DBA roles and a description of what it is and how / where I have used…

Read more

0 comments, 308 reads

Posted in SQL Server 365 on 24 January 2012

Determining Active Directory Group Membership

As discussed in my previous post I prefer to use Windows authentication over SQL authentication on my SQL Servers.  There are however two things that I would recommend controlling which is Active Directory Group membership and correct Active Directory design.

Let’s say you have a tiered Active directory group structure…

Read more

2 comments, 492 reads

Posted in SQL Server 365 on 24 January 2012

Security - SQL vs Windows

Security is a very important part of every DBA’s role.   If you are not clued up on security best practices or don’t secure your SQL Servers, you should be concerned as it could end up costing you your job!

I have worked in organisations where the painstaking task of managing…

Read more

1 comments, 295 reads

Posted in SQL Server 365 on 23 January 2012

Newer posts

Older posts