SoCal Code Camp October 2010!
Posted by: Rick Martinez
I will be presenting at the SoCal Code Camp in October 2010 at USC. There will be two sessions SQL Server T-SQL Recipes, and SQL Server for Beginners. See you there!
I will be presenting at the SoCal Code Camp in October 2010 at USC. There will be two sessions SQL Server T-SQL Recipes, and SQL Server for Beginners. See you there!
The IE .NET Users Group was awesome last night! Llwellyn Falco on “Forensic Development” was one of the best presentations I have attended, great job Llwellyn that is a presentation I will not forget! I got Most Valuable Member, First Runner Up award and lots of great prices with a very nice dinner thanks to James Johnson. I really recommend joining the group. Inland Empire .NET User’s Group
I got a couple of sessions up at the SoCal Code Camp site! I am very excited about this one! Thank you for all your support.
SQL Server 2005 - Designing a Unit Test Plan for a Database
SQL Server 2005 - Developing Applications for Notification Services
To access your shortcut keys within SQL Server Management Studio click Tools, Options, Environment, Keyboard. There you can customize your shortcut keys or create your own. A shortcut key I created was Ctrl + F1 (select top 100 * from ). When you highlight a table name and hit Ctrl + F1 it will select the top 100 records.

If you restore a database on a second sql server and you need to be changing the sql login every time you restore that database you can use CREATE LOGIN. You can use the following sql to create the account on the second server using the same sid from server 1. BOL
There will be a course on “Beginning Database Design” Class runs from Saturday, April 03, 2010 through Saturday, June 05, 2010 its FREE! For more information and to register please visit the site. Seats are limited! Study Group or IE .Net User’s Group
Let me tell you a little story about why I am writing this. We have many SQL Servers running in our environment. We changed the computer name on one of those SQL Servers from Server1 to ServerA. Well from Server3 we could not configure log shipping because SQL Server on Server3 did not know the computer name was changed on Server1 to ServerA.
SQL Server Setup sets the server name to the computer name during installation.
1. Check the server name using SSMS in a new query window where the computer name was changed using the following code. @@SERVERNAME returns the name of the local server that is running SQL SERVER.
a. SELECT @@SERVERNAME AS ‘Server Name’
2. If @@SERVERNAME returns the old computer name follow the steps below.
a. sp_dropserver ‘OldServerName’
b. sp_addserver ‘NewServerName’, local
c. Restart SQL Server Services
Sp_dropserver removes a server from the list of know remote and linked servers on the local instance of SQL Server.
SP_addserver defines the name of the local instance of SQL Server. This stored procedure also defines a remote server.
Striping backups involves using more than one device (disk or tape) for a single backup set operation. When performing a database backup, you can use up to 64 devices (disk or backup) in your backup operation. This is particularly useful for very large databases, because you can enhance backup performance by striping the backup files across seperate drives. Striping the backup files means each file is written simultaneously. Striped backups use parallel write operations, and can significantly speed up backup operations.
Here is a sample:
This creates three files which are each used to store one third of the backup information needed to restore the database.
Hello Everyone, if you attended my session on SQL SERVER 2005 for Begginers you can download the slide presentation and the t-sql code here. Thank you all for your support.
Download SQL SERVER 2008 Express from Microsoft.
Download only SQL SERVER Management Studio Express from Microsoft.
A DML trigger contains t-sql code that is used to respond to an INSERT, UPDATE, or DELETE operation against a table or view. When a data modification event occurs, the trigger performs a set of actions defined within the trigger. There are two types of DML triggers: AFTER and INSTEAD OF. AFTER triggers are only allowed for tables, and they execute after the data modification has been completed against the table. INSTEAD OF triggers execute instead of the original data modification and can be created for both tables and views. Before proceeding it is important to note that SQL Server creates two “virtual” tables that are available specifically for triggers, called the deleted and inserted tables. These two tables capture the before and after pictures of the modified rows. You can also download the sql here.
Let us begin by using the AdventureWorks database. Please follow the steps to create and test DML Triggers.