-
In order for us to be able to create an indexed view, we need to create that view with SCHEMABINDING specified. What exactly does SCHEMABINDING mean? Here is the definition from MSDN: SCHEMABINDING Binds the view to the schema of the underlying table or tables. When SCHEMABINDING is specified, the base...
-
As you probably are already aware, a view in SQL Server is generated off of a pre-defined select statement, and is a flexible solution to use when ever you are doing database driven application development; particularly when you are using an ORM tool (like SubSonic or EntitySpaces as examples). However...
-
In SQL Server 2005 and 2008 the Common Language Runtmie (CLR) is tightly integrated with the database engine, allowing you to write stored procedures in any .NET language such as C# and VB.NET. CLR stored procedures have some distinct advantages over traditional stored procedures, and they also have...
-
In order to make CLR stored procedures run, you must first enable the CLR in SQL Server, other wise you will just get this error: Execution of user code in the .NET Framework is disabled. Enable "clr enabled" configuration option. Enabling the CLR is fairly simple, just run this SQL Statement...
-
On a few of the mailing lists I am on for developers (primarily ones related to web development), there is a recurring topic that always gets people into rather heated debates: to use stored procedures or prepared statements? Now, either one you choose to use, is largely dependent on two things: preference...
-
Recently a friend of mine called with a question about how to do something in T-SQL that he wanted to do for the leaderboard for a game he wrote. The issue was that tens of thousands of people are playing his game (on the iPhone) and the screen real estate only allowed for about 10 players scores to...
-
Data Normalization , refers to creating a structure to store your data in that results in reduction/elimination of redundant data. In a pure normalized form, a piece of data exists only in one place. Anywhere that the data is displayed is only making a reference to that data and joining tables together...
-
Recently I got a request for a top 10 list of things that a DBA should be doing on a daily basis from an engineering managers perspective. Well, here is what I came up with, and please note, that this list is dependant on the poor guy being a full-time DBA, not some programmer who also doubles as a DBA...
-
Many times I have found myself needing to make changes to an existing table that is being published for replication. Here is a script that I have been using for a few years now that has served me well and never caused issues. Hope you find it useful. -- @publication is the name of the Replication Publication...
-
Found this great article on interpreting PERFMON statistics. Being able to make sense of this is critical to doing advanced performance tuning on your SQL Server. This type of stuff goes more towards system administration more than programming. I myself tend more towards fixing things from a programmatic...
-
ClearTrace is a free tool available for download that will analyze SQL Server trace files and trace tables to give you a normalized view of query performance. It offers various sorting capabilities From the site: ClearTrace imports SQL Server 2000 and 2005 trace (and profiler) files into SQL Server and...
-
Today we had a need for a query that would return information on a stored procedure and give us a list of parameters, datatypes, and max values. This functionality is built into the data adapter but we wanted a little bit more flexibility on how we used the data that was returned. Here is what we came...
-
Ok, so this weekend I was reading up on some ways to write high performance T-SQL, as I am always on the hunt for new ideas. I came across this link where the author, Tim Chapman, has written a series of articles on SQL Server programming, administration, performance tuning and other related topics....