Tag

T-SQL

SQL Server Do's And Dont's

So, you are now the leader of a SQL Server based project and this is your first one, perhaps migrating from Access. Or maybe you have performance problems with your SQL Server and don’t know what to do next. Or maybe you simply want to know of some design guidelines…

Advance SQL Injection

There are a lot of web site attacking method now a days, one of the most attacking method that we can easily found is the SQL Injection. First of all, before you know about the SQL Injection, you may need to know what is SQL. Structured Query Language (‘SQL’) is…

Convert varchar into math calculation

I try to google, call, msn my friend to find out the solution when I stay back in my office until late night yesterday. But still no luck after few hours of trying. Thinking of gave up when back to office this morning, but one of my friend suddently send…

ISNULL, NULLIF MsSQL function

I just found out this usefu function in MSSQL when I try to Google for the solution to replace the null value with something else. So that I no need to do the checking again in my application. The function is call NULLIF and ISNULL This 2 functions are actually…

Insert multiple record into table

In SQL, basically there are two ways to Insert data into a table; one is insert it one row per time, another way is insert multiple rows at a times. For the first method (insert one row per time) is the most common way to insert data into database that…

Get the number of row in database table

Normally to get the number of row for a particular table, where we will do is as the following query: select count(*) from Table_name Yes, you may get your result very fast if your table is very small, but if your table is more then 100k rows, then you may…