How to Generate / Create SQL script from stored procedure

Not long ago, I was working on “SQL Synchronizer” -a tool of my own to help synchronize stored procedures from source server / database to target server / database. Use of this tool will become handy when you want to synchronize different environments currently having different versions of stored procedures.

The idea behind developing such tool has struck my mind while moving my changes from development to staging. Though execution of DDL statements went through fine, execution of stored procedures themselves failed as the dependant objects of these stored procedures where not in sync. So, I started to build a .NET project to help me add, delete, update stored procedures either from source / target databases. I shall post the solution to share with you guys, please bare with me for awhile.

Continue reading

SQL SERVER Generate Password Function

Most of you might have come across need for creating a random password for the users. I prefer using passwords that are generated completely random, containing a-zA-Z0-9 and some special characters, making them tough to guess. However, thinking from the user’s perspective those passwords are really hard to remember. So, if you want to leverage complexity of the passwords for making them easy to remember then here is what I have used. Continue reading

Should I use DataTable or NOT?

Usually, when ever we need to show some data from Database to screen , we set DataGrid / GridView control’s datasource property to DataSet / DataTable object. If you were not using DataTable / DataSet as media to bind data to Grid, my sincere apologies for including you in (we). Most of us are following this practise and after my recent experimentation(more details below), I would rather keep away myself from DataTable / DataSet. Why? Continue reading

SqlDataSource – Is it cool?

ASP.NET 2.0 is cool but oh yes, its buggy.

Just like other .NET application developers, I was very much excited about the ASP.NET 2.0 release. I scored a Visual Studio 2005 DVD from release launch event, organized in NYC. From the day one I started working on developing my application in ASP.NET 2.0.

During this course of days, I am very much pissed with the way it works. So far Microsoft Visual Studio Team boasted about more than 50 new controls. The very first I worked on is SqlDataSource & GridView. Continue reading