Someone was talking about curly quotes and how we shouldn't type them because the code interpreter for some the software we are dealing with wouldn't like them (like most other languages). So I started thinking - “how the heck would I even type a curly quote”? It's pretty easy.
I was looking for a code example of this on the web, but couldn't find it, so here it is. You would need to create the @cmd of course with your own variables.
SELECT @cmd = 'restore filelistonly from disk = ''' + @localBackupPath … Continue Reading ››
Here is a bit of code, adapted from Nigel Rivett's original. You can use this to copy one database over another or restore the most recent database over itself.
WARNING: Use caution in running scripts you find on the internet. You are responsible for the well being of your systems!
We're sitting around waiting for the SAN monkeys to fling some crap our way - not the SAN guys, the SAN monkeys, kinda like gremlins, but not as bad. Our … Continue Reading ››
When a cube fails to process, you don't want to hear it from your customer. As the last step in our datawarehouse load, I was processing a cube, using the script generated from the SSMS dialog. That was working fine most of the time, but sometimes we'd have a development failure after some … Continue Reading ››
I'm getting a little tired of always clicking around in SSMS. Here goes a shot at powershell. I've done a few tutorials on powershell, but don't use it enough to remember. The only thing I remember is Get-Child-Items and it's alias GCI. That's a start. Follow along with me.
This cursor inserts all of the roles and members from each database into your admin database.
USE [SQL_DBA_Sandbox] GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Roles]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[Roles]( [DBName] [varchar](max) NULL, [Role] [varchar](max) NULL, [Member] [varchar](max) NULL ) ON [PRIMARY] END ELSE Continue Reading ››
I've one-upped Brent on one point. We have an SSIS package which restores databases from server to server using our DBA_REP databases which I borrowed from Continue Reading ››
You can manage all your servers from one window. Save authentication information. Create groups. I'm sure there is more, but that's all I needed to hear before … Continue Reading ››