SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Technological Movements and the Herd Mentality....

It's amazing to me how the herd mentality works in Technology (and many other things) sometimes. I get the idea that since there are so many new things happening in Technology all the time, it is automatically assumed that "new = good" and "old = bad". I believe that this… Read more

1 comments, 1,021 reads

Posted in Sam Bendayan's 2 Cents on 29 November 2011

Inline TVFs can't use FORCE ORDER hint but Multi-Statement TVFs can...?

Doing some work with converting Multi-Statement TVFs to Inline TVFs and I'm finding that the Inline TVFs cannot use the OPTION FORCE ORDER hint. Multi-Statement TVFs can use it just fine. Does anyone have any more info or experience on why this is the case?

Read more

0 comments, 618 reads

Posted in Sam Bendayan's 2 Cents on 8 November 2011

More info on nested views causing performance problems

 As if I needed any further convincing that nested views were bad....

The other day I had to write a particularly ugly query to recover some lost data.  The query was complicated (please don't ask) and the resulting SQL had 5 (five) levels of nested views.  I realized that this… Read more

0 comments, 1,118 reads

Posted in Sam Bendayan's 2 Cents on 15 February 2011

Strange issue while using IDENTITY values in INSTEAD OF triggers

Found an interesting issue last week....it goes like this: If you are using INSTEAD OF triggers on views (in SQL 2005) and you need to retrieve IDENTITY values you have to be very careful how you do it. It turns out that a simple SELECT from the inserted table can…

Read more

0 comments, 721 reads

Posted in Sam Bendayan's 2 Cents on 23 December 2010

Range locks do not only occur in Serializable transactions....

According to BOL, "Key-range locks protect a range of rows implicitly included in a record set being read by a Transact-SQL statement while using the serializable transaction isolation level".  From this I took it to mean that Range locks are ONLY used in Serializable transactions.

So then I had to… Read more

2 comments, 963 reads

Posted in Sam Bendayan's 2 Cents on 22 September 2010

Professional Licensing for Software Professionals?

Over the past few days I have been thinking that the Software Industry is in drastic need of a Professional Licensing mechanism. I cannot even begin to imagine how much it costs businesses when they hire people that are unqualified, and there is presently no mechanism that I know of,… Read more

3 comments, 1,112 reads

Posted in Sam Bendayan's 2 Cents on 14 July 2010

Option missing in NTILE function?

Just saw something interesting....we have a requirement to divide a result set into a certain number of groups that have a certain size. This size is controlled by a configuration setting, so the user expects to see groups of At first glance I thought the NTILE function would be the… Read more

0 comments, 590 reads

Posted in Sam Bendayan's 2 Cents on 9 June 2010

Nested views causing query performance woes....

Just ran into an interesting issue AGAIN. It seems that when you nest views in a query you are opening the door for massive performance problems. I have seen this in the past, but it appears intermittently and apparently only in cases where you are using complex SQL. The problem…

Read more

3 comments, 6,418 reads

Posted in Sam Bendayan's 2 Cents on 5 April 2010

Access Analysis Services via T-SQL?

It occurred to me the other day that it might be interesting to manage aggregates in an SQL Server database by actually moving the aggregate values to Analysis Services and having the Stored Procedures from SQL Server access the Analysis Services cube by using straight T-SQL. I see that it…

Read more

0 comments, 798 reads

Posted in Sam Bendayan's 2 Cents on 22 March 2010

BiTemporal Tables, anyone?

I'm doing some interesting research on using BiTemporal tables and I was wondering if anyone out there has any real-world experience using these. Basically these are tables where you have effective dates and audit dates in the same table. You may know these by other names, such as 'Valid Time…

Read more

0 comments, 642 reads

Posted in Sam Bendayan's 2 Cents on 11 March 2010

More posts coming soon...

Haven't been around for a while, but doing some interesting work with Database Refactoring and Effective Dating...more posts coming soon....

Read more

0 comments, 536 reads

Posted in Sam Bendayan's 2 Cents on 10 March 2010

Beware the REPLACE function when doing heavy string parsing


I found something interesting the other day.  I was attempting to optimize a very heavy string parsing routine using T-SQL and was having problems.  I don’t normally use T-SQL for such heavy string parsing, but this was a special case of a legacy structure that I had to work… Read more

13 comments, 5,674 reads

Posted in Sam Bendayan's 2 Cents on 23 August 2009

To Date or Not To Date….


OK….so I’m in the middle of a very interesting Effective Dating project…basically we’re dealing with some tables that only store current data, but there is a need for future-dated data as well.  Because the base table can’t hold that data, we have to come up with additional tables and… Read more

13 comments, 1,514 reads

Posted in Sam Bendayan's 2 Cents on 13 May 2009

Welcome to Sam Bendayan's 2 cents.....content coming soon...

You will be at least 2 cents richer....

Read more

0 comments, 484 reads

Posted in Sam Bendayan's 2 Cents on 12 May 2009

What's a 'DBA'?

Most of us are tired of this overused, vague term. How many of you have clicked on a 'DBA' job posting only to find that it's not what you do? Or asked for a DBA resume from a recruiter and gotten something other than what you expected? Or how about… Read more

37 comments, 1,101 reads

Posted in Sam Bendayan's 2 Cents on 12 May 2009