MSSQL


19
Sep 09

HOWTO: Properly connect to MSSQL database

There are many ways you can con­nect to a data­base in ASP.NET, the way i’m going to explain here based on “try and error” dur­ing my devel­op­ment years. I will try to explain why i do each step and what errors i had in the past so you may pre­vent these in your web appli­ca­tions. Expe­ri­enced pro­gram­mer should know each of these steps and may dis­agree so dis­cus­sion is open to debate.

Con­tinue reading →


13
Sep 09

HOWTO: Group rows by day in MSSQL

This trick is usu­ally use­ful in sta­tis­tic where you need to count or sum records based on record day. Using it will help you group­ing rows by day or month depends on your needs.

Con­tinue reading →


12
Sep 09

HOWTO: Schedule MSSQL query task

Check the images below to learn how to cre­ate a sched­uled mssql query task using Microsoft’s Sql Server Man­age­ment Stu­dio. Red zones are the most impor­tant for you to check or to click on and black zones are the ones you not sup­posed see because screen­shots were taken from live server.

Con­tinue reading →


11
Sep 09

HOWTO: Loop though each query result or MSSQL for loop

Many times i found myself in trou­ble ( Bea­t­les ???) when i needed to change sql tables design based on some con­di­tional logic so i couldn’t use Insert Select tech­nique sim­ply because it doesn’t sup­port if state­ments when i needed some­thing beyond when con­di­tion abil­i­ties.

Con­tinue reading →


10
Sep 09

HOWTO: Redesign sql table using Insert Select technique

My require­ment was to totally redesign the table when i couldn’t just per­form delete and update tasks on it. In this exam­ple i cre­ate new table based on old table’s fil­tered result set.

Con­tinue reading →