Skip to content
  • Blogs
logolong
Search
logolong
Search

Quick backup of all your SQL Server database

ASP.Net / Jim Brooks

select ‘BACKUP DATABASE ‘ + name + ‘ TO DISK = ”C:\Work\BackupDBs\’ + name + ‘.bak” WITH FORMAT, MEDIANAME = ”SQLServerBackups”, NAME = ”Full Backup of ‘ + name +”’;’ from master.sys.databases where database_id > 4 AND name <> ‘db_temp’ ORDER BY NAME Then run the result set. To make the restore commands use: select […]

Quick backup of all your SQL Server database Read More »

I Love Idea Paint

Leave a Comment / Uncategorized / Jim Brooks

We just received our Idea Paint that we are going to put on one of the walls in our new workout room. This reminded me of when we painted the main conference room in the office building I worked in.  It was a big conference room with 2 little white boards that always had “Do

I Love Idea Paint Read More »

SQL Server 2005 to 2012 Differences for Developers

Leave a Comment / Uncategorized / Jim Brooks

We are upgrading from SQL Server 2005 to 2012. There are a lot of features for developers that have been added over those 7 years.  Here are some you might find useful. 1. You can assign a value to a variable when you declare it. Copy Text Copied Use a different Browser DECLARE @Status varchar(50)

SQL Server 2005 to 2012 Differences for Developers Read More »

Auto Feeding the Cat with Video Confirmation

Leave a Comment / ASP.Net / Jim Brooks

From a scheduled program I wrote on my laptop, I wanted to turn on an electric wall outlet, which would then turn on the cat’s auto feeder. The wife said she didn’t trust this to work, so she needed a video showing the cat being fed. So I combined all the Z-Wave tools with some other

Auto Feeding the Cat with Video Confirmation Read More »

Programming Your Home

Leave a Comment / ASP.Net, C# / Jim Brooks

I wanted to do some home automation, and I wanted to write the code myself (I’m a software developer.) I looked into it and decided to use Z-Wave technology.   I started by buying a USB Z-Stick for about $45 to allow my laptop to talk to the different devices. This can control up to 232

Programming Your Home Read More »

Recording Deletes When Using Entity Framework

Leave a Comment / ASP.Net / Jim Brooks

I have all the changes archived to archive table using triggers, but this doesn’t record anything when a row is deleted. I created a dedicated table to record the deletes. Copy Text Copied Use a different Browser SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Deletes]( [id] [int] IDENTITY(1,1)

Recording Deletes When Using Entity Framework Read More »

Generating Archive Tables and Triggers

Leave a Comment / ASP.Net / Jim Brooks

I create archive tables to log all of the changes made to a table. The archive tables look like the base table with a few columns added. Then the base tables need a trigger to insert the old row right before a change. I used the stored proc below to generate the archive tables and

Generating Archive Tables and Triggers Read More »

Generating Indexes for Foreign Keys

Leave a Comment / ASP.Net / Jim Brooks

Surprisingly, SQL Server doesn’t automatically create indexes just because you have a foreign key. So at the end of a development project, I just used the script below to generate the SQL needed. Copy Text Copied Use a different Browser select 'create index indx_'+t.name +'_' + c.name + ' on ' + t.name + '('

Generating Indexes for Foreign Keys Read More »

Show Child Count in a DataGrid

Leave a Comment / Silverlight, WPF, XAML / Jim Brooks

I have an application with the following as part of the data model: So an Account can have many Users and a user can belong to many Accounts. I wanted to show the Accounts in a DataGrid along with the number of Users that were linked to that account like show in the 3rd column

Show Child Count in a DataGrid Read More »

Generic Boolean to Text Converter

Leave a Comment / Silverlight, WPF, XAML / Jim Brooks

I’ve seen this done a few different ways, but I think this is the best way because you can reuse it. Below is the converter. Notice the 2 public properties. Copy Text Copied Use a different Browser public class BoolToTextConverter : IValueConverter { public string TrueText { get; set; } public string FalseText { get;

Generic Boolean to Text Converter Read More »

1 2 … 5 Next →
  • Blogs

Copyright © 2026 Digital Tools, LLC | Powered by DigitalTools.com