Archive for December, 2011

With my new rig I bought an average graphic card as well. I am not hardcore gamer at all but I do sometimes like to shoot some zombies or build my galactic empire … so I bought this cheap but very nice graphic card from ATI Radeon 6770 HD from Sapphire. And I must say that I am really impressed with this little beast. Thought it is not top of the line card, so far it is able to let me play all latest games I throw at it.

After my successful attempt to OC my AMD Processor, my hands were sort of twitching to OC my GPU as well. Just like all ATI cards, mine was also using “ATI Catalyst” software for control and setting up advance graphic options. While just browsing these options I found that it has a rather interesting option, ability to overclock the GPU and it’s RAM !! I googled a little bit about OCing my graphic card model, but I didn’t found any helpful settings which I can use for my graphic card. So, I decided to do my own little trial and error thing.

SQL Server sometimes behaves very strangely for no apparent reason. Few days back I was playing with our staging server and I had to stop SQL Server service for some testing purposes. When I started it back, I saw that SQL Server Agent was disabled and next to it a message showing that “Agent XPs disabled”

From my experience it generally means that SQL Server Agent service is not running. But looking at SQL Server Configuration Manager I found that service was just OK. But just to try, I restarted SQL Server Agent but I was still getting same message and disabled SQL Agent !!

After some googling I found that it is rather very common issue with SQL Server Agent !! Apparently sometimes for no reason, Agent XPs gets disabled in SQL Server environment. When I ran,

SQL Server Integration Services (SSIS) are really nice ELT tool for data transformation, conversion and transfer. But they not of much use if they can’t be configured to accept different parameters. For example, a once task to move file is designed if it can’t be used to look for file in different folder or FTP task can’t connect FTP site other than the one coded in task itself. In these cases a configuration file generated to be used with DTSX package can be really handy. Configuration files for SSIS package allows us to make our package more flexible (or say configurable). We can store all kind of parameters into this configuration file, which will allow use to change package behavior by changing package parameters.

For sake example, I have created a sample project with file transfer task. This package just looks into specified folder and moves any txt file exist in that folder to another location. This project is using a configuration file which allows user to change target and source folder location, and we can also change what type of file this package will move (e.g. Text, PDF or all files).

Steps to create configuration file:

1) Create three variables using variables window. One will be source folder path, second will be destination folder path and third one is just a file name. (if Variable window is not open, it can be accessed from View –> Other Windows –> Variables)

2) Drop “Foreach Loop Container” into control flow tab. And then place “File System Task” inside of “Foreach Loop Container”. This basically means that this “Foreach Loop Container” will execute that “File System Task” every time it loops through.

I was working on one of my personal projects and I thought that it would be really cool if I have my own source control mechanism so I can always rollback to older versions if I ever need to do it. Till now, I was always just keep multiple copies of each project so if I have to rollback or even just have to compare files then I just open them up and compare it. But with my prolonged exposure to SVN, I found that it is more easy if I have some sort of source control server, I can use it to keep all of my repositories and it will make my like more easy. So just last night I finally completed that task.

To setup dedicated Visual SVN Server I used virtual machine with Windows 2008 Server (having 16 Gigs of RAM really helps ). Just make sure that machine has static IP, because DHCP will have random IP of machine and then it could be wonky for SVN Server.

In T-SQL there is really interesting clause available which allows DB engine to execute some particular module (function, SP, trigger etc) with context to some user. This clause is very handy when we don’t want some specific user to have access to some schema but we still want that user to allow access to data from that schema.

MSDN describes this situation as,

By specifying the context in which the module is executed, you can control which user account the Database Engine uses to validate permissions on objects that are referenced by the module. This provides additional flexibility and control in managing permissions across the object chain that exists between user-defined modules and the objects referenced by those modules. Permissions must be granted to users only on the module itself, without having to grant them explicit permissions on the referenced objects. Only the user that the module is running as must have permissions on the objects accessed by the module.

User can use “execute as” clause different arguments, which are “CALLER”, “SELF”, “OWNER”, “user_name” and “login_name”. All details are well explained on MSDN so I am not going to explain use of all arguments. But I am particularly interested in “user_name” argument. Use of this argument allows us to execute specified module in context to some user name. Wait, does it means that if I create a SP for accounting schema with context to admin will I have access to that schema ?? Not necessarily, to be able to execute any module that uses this clause requires me to have EXECUTE permission for this module. Also you will also need to have IMPERSONATE permission for module if you want to use this clause in your module.

With this basic intro, I’ve created sample scripts to test this feature. I’ve create a test DB and one schema and a user who doesn’t have access to this schema, but have execute permission of DB.

I know, it sounds strange. But it is fact that when we install Windows 7 or Vista (say any non-server post XP OS ?), and even if select ourselves as local administrator we actually don’t become administrator !! And due to that even if you disable that notorious UAC notifications you will still sometimes need to run apps as admin by right click and say “Run as Administrator”.

Now, it is really annoying and I feel helpless that even though MSFT says I own my system, I still not own it ?? When I says I want to be an administrator that means I want to be an administrator, and I don’t have to run any stupid program with elevated privileges by right clicking on it.

Ofcourse being a Linux user I am sort of habituated with these annoyance of Administrator and Power user. And I truly believe that sometimes they are very useful to have specially for users who don’t know much about computers and have administrator rights to screw system up (well, even if they don’t have admin rights they still screw system up, but that is another subject of conversation )

One of my favorite “How To” site, has posted a way to enable real Administrator account in Windows 7 and I am sure it is not recommended for general user, but for power users it is really useful.

High availability is a system design approach and associated service implementation that ensures a prearranged level of operational performance will be met during a contractual measurement period.

And it could include multiple database and application server connected in a clustered environment with redundant hardware. One of the method to make ASP.NET application available even if one server goes down it so make your application connect to secondary db server in the even of failure to connect to first server.

This post is to show this concept. (I am not very proud of my programming skills and I prepared this demo app in 15 mins, to please bare with me)

This simple app connects to one DB and if it fails (or gets timeout) it connects to second db. I am using SQL Authentication and this table is same on both Servers.