Nifty SQL Server SQL Statements

Most of the time I find myself forgetting some simple syntax for SQL statement and I spend some time googling the correct syntax. So I thought why go google when I can just put a post in the site and keep the link handy. Here goes the first syntax

Change a column size


If there is a table called student and it has a column called firstname with data type as varchar(100). If we we want to change the size of the specific column then the above syntax will translate into code as


Change a column name


sp_RENAME 'TableName.CurrentColumnName' , 'NewColumnName','COLUMN'

The system stored procedure sp_rename will get the job of renaming a column done for you. The syntax will translate into code as

sp_RENAME 'Student.FirstName' , 'GivenName','COLUMN'

I will keep updating this post with more SQL statements as I keep digging more.

Getting Started – Virtualization The Beginning

I wanted to get started with Linux without making much of fuss with the existing windows setup I had. There are several ways that we can do this but the easiest way has to got to be Virtualization.

Virtualization is the creation of a virtual (rather than actual) version of something, such as an operating system, a server, a storage device or network resources.

These days most corporate companies use this technique to deploy multiple servers in an instant, well not in an instant really but yes at much shorter period of time as well cost. Virtualization is not just big companies to flex their muscle but also for small timers like us who can test an Operating System without a fuss. With Virtualization gone are the days where we needed to burn the OS Image onto a CD or DVD for installing the OS. Gone are the days where we peered into the screen trying to figure out what how much space needs to be partitioned in such a way that the existing partition/OS does not get affected.

Continue reading

Getting Started – Basic DB Operations in RavenDB

I was recently was looking at NoSQL based databases for a personal project that I was working on. I did not want spend a lot of time designing the perfect database for an application which might or might not be used extensively. For this I checked out MongoDB and I had decided to go with it but while searching a database native to dotnet I saw RavenDB and felt it might be an appropriate fit for my simple application for the simple reason that RavenDB is fully written in dotnet. I downloaded the binaries for RavenDB and started playing with the db. The five main operations that we do on a database are

  • Adding records to the table.
  • Showing all records in the table.
  • Updating existing records in the table.
  • Deleting records in the table.
  • Searching for a specific record in the table.
  • Continue reading

    Just A Number

    In anger and agony I write this.

    I am just a number on the board for people with ties to count
    I exist solely to serve , they crucify me
    I dance with the devil every day
    They dance with the princess every day
    In my infancy, promises many they showed

    Showed me the shining crystals of the heaven
    The beautiful damsels of the heaven
    Showed me I bear the torch for the future

    What I didn’t know
    I was just a twig that burnt in the flame
    Just like the other million twigs,
    just a twig is what I am
    Everyday they roast me and freeze me
    They do it again and again forever and forever
    Till my mortal body can bear the brunt of the pain
    Just another pawn in the game, just another pawn
    Played to the core, will i survive, only the time may know

    Will I get out of this maze, time will only tell
    Clinging to hope, I beleieve I can survive
    I am carrying on braving all that the time can throw at me

    Reading and Writing an Xml File the Simple Way

    This FAQ introduces you to the world of XML in DotNet. It demonstrates how to use two built-in classes in the dotnet framework for reading and writing xmls. The classes, XmlTextReader and XmlTextWriter, help you to read and write to xmls in a very simple manner.
    Language : Visual Basic.Net
    Framework : .Net Framework version 1 or 1.1
    Imports : Continue reading

    Debugging JavaScript code in MS CRM 4.0

    It was real tough not knowing how to debug JavaScript Code in MS CRM 4.0. Every time I had to publish the forms and test with Alert Messages. It really got on my nerves and thought I better find a way out of this and that is when Stunnware helped me. I wanted to share the learning with you and here it is…
    Open the Internet Explorer settings and select the Advanced tab. In the list of available options find the “Disable Script Debugging (Internet Explorer)” setting and make sure it’s unchecked.
    Open any script you want to debug and place the following just before the statement where you want to start your debugging session: Continue reading

    Beginner’s Guide to Visual Basic 6 – Part 2

    In Part 1 we touched the basic’s, now we will move to the next step.

    System Defined Functions: Now the second chapter, we will deal first with some of the system-defined functions in vb. What is this “function” ? Well a function is a special type of procedure that returns a value each time it is called. A function is generally used to perform a particular task/s repeatedly when needed. Visual basic provides several built-in functions as part of the programming language, such as MsgBox, Round and so on. We can also create our functions which does a user defined task. We can pass arguments to that function and return a value also based on the parameters. There are 4 types of functions in Visual Basic and they are as follows Continue reading

    Beginners Guide to Visual Basic 6 – Part 1

    I’ve seen couple of posts in the site where people have like asked the basic questions about VB. For instance, is there a need to declare a variable and what is the use of a module and so on. So this is tutorial is first of the series that I am writing. Now I will go for some bookish definition of VB.

    General Information on Visual Basic 6.0
    Visual Basic 6.0 is RAD tool. RAD means Rapid Application Development Tool. It is very easy to create a Data-Entry Form using VB. If it takes a 6 months for you to create a C++ application, it will take only 6 minutes for you to do it in VB. VB 6.0 has many powerful features that are required in today’s programming environment. Some of them are as follows Continue reading

    Automatic Time Tracking an Overview

    A lot of times, i have felt I have worked more than my body can handle but when I took toll of the tasks, it seems most of them were not completed or was in a very bad state. I was not sure where I was going wrong, I had a fair idea that my browsing was causing some damage to my time management but I was not sure as to how much damage it was causing.

    To rectify this, I took it upon myself to create a simple application in .Net (C#) which would keep track of time. Initially I thought, let it run in my system tray and manually enter tasks one by one and the time on which I was working on it. It was a realistic idea but not for me, like i said, my laziness was getting to me and I wanted a way to automatically start accounting for the work I do in my computer. Continue reading

    Using Property Collection in MS CRM 4.0

    While using Properties in MS CRM 4.0 one has to be careful as to which dotnet namespace you are instantiating it from. For MS CRM purposes, you need to make sure you instantiate it from Microsoft.crm.sdk and not from System.Data namespace. If you type the following code

    PropertyCollection pc_Dummy = new PropertyCollection();

    In the above line the word “Property Collection” will be show in Red in the Visual Studio IDE. This can be resolved using the following piece of declaration code. Continue reading