set context_info -- Option to get parameter value during session across multiple batches

/*some time we need to use parameter values to be available for multiple bathces in same session
We can use context_info this case. Its value is available during current session and we can get its info from
sys.dm_exec_requests
sys.dm_exec_sessions
sys.sysprocesses

*/

Maintenance :- Job History (sp_delete_backuphistory)

/*
Recently for one of my client I found that his backuphistory table has become very large. Since SQL Server do not clear backupjob history we need to clear it regular interval
*/

MDX:-Total of last N Days from Today.

Since I dont have forums on this blog.I would like to post the problems by mail using blogs.
Recently I got a problem to get sum of last N days from current Date.

Table Partitions

Table Partition is a new feature in SQL Server 2005.
Here I am posting a sample code how to create a Partitioned table and view its meta data in system tables.
/* We need to create a partition scheme and function on which we will partition the data */

Popular Posts