Home » Archive

Articles in the Programming Category

Programming »

[8 Oct 2009 | No Comment | ]

Suppose you want to update a field in a database table based on row number, and you want to start with 20000.

Programming »

[2 Sep 2009 | No Comment | ]

COALESCE is a very useful function, if you want to build a string of data from a field in a database table.

Photography, Programming »

[18 Aug 2009 | No Comment | ]

About 1 or 2 years ago, I read an article on the internet about a programmer who let his clients pay him as much as they like (I forgot who he was and what the link was, unfortunately). He claimed it worked. Some people paid too little, some too much. But most of the time, his clients pay just about right. So, in the end he earns enough. I’ve been wondering since, would it work for me, if I implemented the same?

Programming »

[11 Aug 2009 | No Comment | ]

There are two types of login authentication on SQL Server 2008, Windows authentication and SQL authentication.

Programming »

[11 Aug 2009 | No Comment | ]

If you try to delete a user from SQL Serve 2008 and receive this error:
the database principal owns a schema in the database, and cannot be dropped. (Microsoft SQL Server, Error :15138)
like the error message suggests, that has something to do with a schema related to it.

Programming »

[10 Aug 2009 | No Comment | ]

If you just upgraded your database to SQL Server 2008, you want your database to be compatible with SQL 2008, of course. To see which compatibility your database currently has, just type the following query (new in SQL Server 2008):

Programming »

[28 Jul 2009 | No Comment | ]

It’s pretty simple. Just run the following SQL statement on the database you are working on:
SELECT * FROM Information_Schema.TABLE_CONSTRAINTS
WHERE TABLE_NAME = ‘mytable’ AND CONSTRAINT_TYPE = ‘foreign key’
As you can see, this query can be used also for looking other CONSTRAINTS.

Programming »

[5 May 2009 | No Comment | ]

Everyday we are dealing with dates. Daily reports, monthly sales, annual projections, etc. Here are few tips how to get dates you want from a Microsoft SQL Database (tested on SQL 2005 Server).