I often wondered why is there no ISortable interface of somekind in .Net. I recently needed to sort items in the context menu in alphabetical order. Sorting them was the begining of a journey which produced this class.
Read more →
I had to convert a project from .Net 1.1 to .Net 2.0 this week. It built ok with a few warnings. Amongst others there was this one: Warning: 'System.Threading.WaitHandle.Handle' is obsolete: 'Use the SafeWaitHandle property instead.
Read more →
If there was one thing that was going preety steadily on my nerves in VS2005 was region collapsing/opening with mouse. So i was determined to find a shortcut for it.
Read more →
I've stumbled accross this post today that explains the Rozenshtein method of pivoting data.
It's quite interesting. I haven't seen the SIGN() function being used at all in SQL server in practice yet so this is kind of cool if you ask me :)
Read more →
I ran into this little gem today while doing some deletes and forgeting Delete syntax :))) There is now Output clause for DELETE, INSERT and UPDATE statements. It outputs the affected rows into a table variable, a simple resultset or into a table.
Read more →
Here's an interesting way of contencating values in one column. It makes use of the new XML capabilities.
use master select column_name as col1 FROM INFORMATION_SCHEMA.Columns WHERE table_name = 'spt_values' select (select column_name as col1 FROM INFORMATION_SCHEMA.
Read more →
According to Donald Farmer who visited Slovenia a few months ago importing flat files with SQL Server Integration Services is the fastest way today to do that. SSIS now has a special very fast and very optimised library that transforms flat file text into appropriate SQL Servers datatypes.
Read more →
We're all familiar with four constant columns that should be in every table. Those are: CreatedOn, CreatedBy, LastUpdatedOn, LastUpdatedBy or any other names you have for them. :)) But you get my point.
Read more →
This is a good explanation on how to acctually bill a customer for your service over a credit card in your web application.
More here.
Legacy Comments
anwar
2006-06-14
re: Integrating Electronic Payment Processing into ASP.
Read more →
This is an interesting thing to know. It seems that automatic update of statistics doesn't work for small tables (up to 500 rows) on SQL server 2000.
More here.
Legacy Comments
Tara
2006-05-12
re: Manual Update statistics on small tables may provide a big impact Posting the same comment from the forums:
You aren't supposed to rely on the auto update statistics anyway.
Read more →
in xp_sprintf up to 50 arguments can be specified. sometimes there's a need for more. This is it and it could as easily be rewritten as a function.
create proc spSPrintF @body varchar(8000) = '', @params varchar(1000) = '', @paramSeparator varchar(10) = ',' as begin if @params = '' begin select @body return end -- so we don't have to specially handle the last item set @params = @params + @paramSeparator declare @param varchar(200) while @params <> '' begin select @param = replace(left(@params, charindex('"' + @paramSeparator, @params)), '"', ''), @body = stuff(@body, charindex('%s', @body), 2, @param), @params = replace(@params, '"' + @param + '"' + @paramSeparator, '') end select @body end go declare @body varchar(8000), @params varchar(1000) select @body = 'This is a %s text i have to %s with some %s i want', – Parameters must be in format '"parameterValue","parameterValue2","parameterValue3"' – no spaces between parameters!
Read more →
Visual studio's DataSet visualizer is ok but it's not that great :))
This one is excellent and if you do a lot of db development (which you do if you're reading blogs on SQLTeam :)) you need this.
Read more →
As i saw this word being used with blittable and non-blittable datatype i couldn't help but laugh… who comes up with this stuff?? Blittable types are datatypes that don't require conversion when passed between managed and unmanaged code while non-blittable datatypes are represented differently in managed and unmanaged code.
Read more →
I've posted an article about WebDAV protocol and my use of it for accessing MS Exchange store. WebDAV is based on HTTP 1.1 and is based on sending XML requests to find, set, remove and search for item properties.
Read more →
What is WebDAV? WebDAV stands for "Web-based Distributed Authoring and Versioning". It's a set of extensions to the HTTP protocol which allows users to collaboratively edit and manage files on remote web servers.
Read more →
you paste the code you want to display on the page and it creates the color coded html. preety cool… http://www.manoli.net/csharpformat/ there's even a source of the app that does the convert that you can view.
Read more →
Maybe i'm reinventing hot water but no matter. It's fun for me :))) These 2 functions round the number up or down on the decimal position we specify.
Read more →
If you do a lot of managed/unmanaged code interaction with COM objects then this is a page you must bookmark.
http://www.pinvoke.net/
Read more →
I stumbled on an interesting thing yesterday while playing… :)) Seems that getting all data from a table is faster if we add a "phantom" where part that forces a clustered index seek instead of a scan.
Read more →
A select statement which returns all rows in nortwhwind..orders uses a clustered index scan. That's great, since it has to go through all of the data… But look at this example:
Read more →