Browse by Tags

21 June 2007
SqlServer: Return Random Records in T-Sql, the GUID way.
In one of the website I have developed, we feature random products displayed on a webpart. This can be done several ways either of the code behind or via t-sql but I think the simplest way to do it is via t-sql with the help of Guid columns. Globally Unique Identifier or GUID is a randomly generated... Read More...
16 January 2007
.NET: Advanced Data Paging with Sorting In SqlServer 2005
dwarvend, a former teammate in my frist company once asked me about data paging large resulsets in ASP.NET. Data paging in SQL Server 2005 is relatively easy with new RowNumber feature but supporting dynamic sorting is little tricky. I have this executable to script to demonstrate this sorting. --check... Read More...
08 November 2006
L10N: The world is flat, start localization on your database
When you are developing software product to be catered to diverse customers, it must be a standard to localized your software. With .NET this has never been easy, on .NET 2.0 its even easier with striongly typed resource files. But localizing application must be part of the architectture and should not... Read More...
02 November 2006
SQL Server: Incorrect decimal column's scale may mean lost money
I have been profiling my codes and my scripts trying to debug why I have lost lots of .50 cents every transaction, given I always use the decimal datatype when computing currency values. The business logic layer persists correct values and profiler shows result with its fractional part being passed to... Read More...
23 October 2006
SQL Server: Copy query results including headers
Maybe some of us are used into copying results of our query and pasting it to Excel for further analysis or reporting, but we are also used into SQL 2000 behaviour. With Sql Server 2005 Management Studio, you can copy and paste the query results including the headers. Just goto, Query -> Query Options... Read More...
21 September 2006
SQL Server: FullText's noise words
Last time I blogged about SQL Server Inflectional Fulltext search filters out artiles like "the", "and", "in" etc. This has caused me headaches than fun when a lot of my test cases for searching failed or returns irrelevant results. I just found out thru my boss that I can turned this off by deleting... Read More...
14 September 2006
SQL SERVER: Inflectional FullText search filters "in", "the", "of", "and" articles
I was surprised tonight as I was testing the search engine of my project. It uses SQL Server Inflectional FullText search, but also supports boolean and simple search. Its good to see that it filter out these "and", "in" "of", "the", and other articles and returns 0 results when used as the only keyword... Read More...
13 September 2006
.NET: SqlParameter default length
An SqlParameter with ParameterDirection.Output has default size of 1 , this can be tricky if you use command.Parameters.AddWithValue(parameter, value) method in .NET 2.0. It was caught on my unit test when I want to retrieve the value of an output parameter, the returnErrorMessage variable must contain... Read More...
06 September 2006
SQL Server: Bit is not boolean
Often we used BIT datatype for representing boolean values, but BIT is not the same as boolean as BIT represents values (1, 0 and NULL). Boolean represents values (True and False). Read More...
02 June 2006
T-SQL: Practice to use semicolon (;)
Yesterday, I was bugged by a syntax error that keeps on appearing on my stored procedure. This code seems to work fine , but it wont: .cf { font-family: Verdana; font-size: 8pt; color: black; background: white; border-top: windowtext 0pt solid; padding-top: 0pt; border-left: windowtext 0pt solid; padding... Read More...
21 April 2006
My database naming standard
In our local developer forum a thread on sql standard naming convention was started so I believe its worth sharing my thoughs here. Tables _<applicationName>_<tableName> Example for database project named "efcodd" _efcodd_users _efcodd_user_status _efcodd_roles I am tired of using "tbl_"... Read More...
08 March 2006
Object Role Modeling (ORM)
Recently I was given a copy of an enterprise database model, probobly 20-250 data tables at my estimate. The model was design by their architect and was given to their developers to take further review. What interest me here is that, it has 0 constraints, 0 relationships given. I discussed it with a... Read More...
02 December 2005
What is trace flag 1400
Trace flag 1400 is a startup parameter on Sql Server 2005 if you want to enable its Database Mirroring feature. By default this feature is disabled and was introduced for evaludation purposes only. Microsoft confers no warrantees and support on production databases that uses Database Mirroring because... Read More...
14 September 2005
Sql Server UDF: convertToProperCase
Just want to share this to you. This might be not so good or optimize in a DBA point of view but definetly helped me presenting db data to users especially when the labels of field on your web site was bounded to db and data are in All CAPS or the All LOWER case. CREATE FUNCTION udf_pretty(@inputString... Read More...
Filed under: