This was one of question asked in a interview. The obvious answer would be no without using a view until SQL 2008. But in SQL 2008 this is possible without the use of view by means of a newly introduced…
RECONFIGURE WITH OVERRIDE
I was recently trying to implement a CLR function in one of my dbs. I deployed and was about to test when i got the error that CLR is not enabled in system and its required for running .NET code.…
SQL Server Agent Job issues-2
I’m continuing my experiences with managing jobs using SQL Server Agent. Couple of days back we faced a strange issue in SQL Server agent. The scenario was we trying to test run set of jobs we’ve set in QA before…
Job history listing in SQL Server agent
Recently I came across a strange issue while dealing with sql server agent. The issue was in one of our recently implemented projects which was dealing with population of data warehouse with data from heterogeneous sources. The population was done…
viewing table permissions in a db for a user
I’ve come across a few occasions where we need to find out permissions for our username on a given table in the database. An easy way of doing this is by means of using the system stored procedure sp_table_privileges. The…
sp_fkeys v/s sp_foreignkeys
sp_fkeys and sp_foreignkeys are two system procedures available in SQL Server giving information about foreignkeys. Then what exactly is difference between them? For this lets see the syntax of both. sp_fkeys ————— sp_fkeys @pktable_name, @pktable_owner, @pktable_qualifier, @fktable_name, @fktable_owner, @fktable_qualifier If…
Finding object reference within jobs
At last I’m back! its been sometime since I blogged. For those who’re thinking where I’d been all this time, I was off to China for project implementation. Unfortunately blogspot was unavailable there which kept me away from blogs. Now…
Using XML to batch load master child
Recently I had a requirement where it was required to populate master child tables with batch data. I chose to pass the data in XML format and then use XML functions to shred and populate the tables with required data.…
Time difference function
The impetus behind this function is that lately I’ve been asked by couple of fellow developers about a way to find out difference between two datetime values in hh:mm:ss format.The function below will give you time difference between two datetime…
Sparse Columns and Column Sets in SQL 2008
A common scenario which I have come across many times in my projects is the case where we need to design a table to store the attributes related to an entity especially when the number of attributes are large and…