Login or Sign Up to become a member!
LessThanDot Site Logo

LessThanDot

A Technical Community for IT Professionals

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

Browsing "sql server 2000"

0

SQL Advent 2011 Day 3: Partitioning

In my Are you ready for SQL Server 2012 or are you still partying like it is 1999? post, I wrote about how you should start using SQL Server 2005 and SQL Server 2008 functionality now in order to prepare for SQL Server 2012. I still see tons of code tha…

Read More...
9

Raise your hand if you have seen code that sends email from within a trigger in SQL Server

Please leave me a comment if you have written or have seen a trigger that is written in such a way that it will send an email when a value changes in a table.

I am looking at the following question: Email trigger when data is changed

ALTER TRIGGER…

Read More...
1

Match your defaults with your trigger values to prevent horrible fragmentation on your indexes and tables

Here is a quick demonstration that shows you what can happen when you use defaults that are much shorter than the value that is updated from an insert trigger. The ModifiedBy column has a default of ” but in the trigger it gets updated to ‘Someapplica…

Read More...
6

Dealing with The multi-part identifier “dbo.Table.Column” could not be bound. error in an update statement

One of the best ways to improve your skills is by helping other people in forums and newsgroups. I was doing just that tonight and I stumbled on this piece of code here: http://stackoverflow.com/questions/3622685/transfer-column-data-from-one-database-to-another T-SQL1 2 3 4 5 update [DB1].[dbo].[Table1] set [DB1].[dbo].[Table1].[Column1] = [DB2].[dbo].[Table1].[Column1] from [DB1].[dbo].[Table1] db1Alias, [DB2].[dbo].[Table1] db2Alias where db1Alias.TeamId = db2Alias.TeamId and […]

Read More...
4

Three different ways of populating variables with configuration values in SQL Server

I have a bunch of processes that run at then end of the day. Some of these processes are configured dynamic since table names, server names, database names and a whole bunch of other stuff might change.
SO you migh have a (over simplified here) table l…

Read More...
27

Do you use Column=@Param OR @Param IS NULL in your WHERE clause? Don’t, it doesn’t perform

You see this kind of question all the time in newsgroups/forums, someone wants to return all the rows if nothing is passed in or just the rows that match the variable when something is passed in. Usually someone will reply with a suggestion to do someth…

Read More...
14

Use sys.dm_os_performance_counters to get your Buffer cache hit ratio and Page life expectancy counters

In order to figure out if you need more memory for a SQL Server you can start by taking a look at Buffer cache hit ratio and Page life expectancy. Buffer cache hit ratio Here is what Books On Line has to say about Buffer cache hit ratio Buffer cache hit ratio Percentage of pages […]

Read More...
0

Use alter table alter column to change datatypes for a column in SQL Server

This question popped in the microsoft.public.sqlserver.programming forum yesterday. A person wanted to change a column from varchar 500 to varchar 2000. This is actually pretty easy to do in SQL Server, you can use the alter table alter column command Let’s take a quick look at how this works First create this table T-SQL1 2 […]

Read More...
11

Best Practice: Coding SQL Server triggers for multi-row operations

Best Practice: coding SQL Server triggers for multi-row operations

There are many forum posts where people code triggers but these triggers are coded incorrectly because they don’t account for multi-row operations. A trigger fires per batch not per r…

Read More...
8

Interesting Increase Key Value Post By CSS SQL Server Engineers

The CSS SQL Server Engineers have posted an interesting post, I myself don’t have any of the fake identity columns but I did many times suggest in newsgroups to use UPDLOCK and HOLDLOCK in a transaction to guarantee that 2 inserts would not generate the same key value. This stuff below is from the CSS […]

Read More...
« Previous PageNext Page »