in

SQL Server Blogs

Voices from the UK SQL Server Community

Browse by Tags

  • Moved my blog

    For all those reading my blog, for your information, I have moved my blog to http://beyondrelational.com/blogs/madhivanan Thanks to Simon for his support at sqlblogcasts.com
    Posted to Madhivanan (Weblog) by Madhivanan on Tue, Feb 2 2010
  • Find alternate week day

    My co-worker had a task of finding minimum alternate week day as of today for a given date and day Consider these data Date : 2009-12-22 day : 5 (it denotes Thursday) It means the event was scheduled on 2009-12-22 which should run on every alternate Thursday starting from 2009-12-24 (The first Thursday...
    Posted to Madhivanan (Weblog) by Madhivanan on Tue, Jan 12 2010
  • Replace data of one table with data of other table

    One of the questions asked in a forum was about replacing data of one table by the data of another table The solution that the questioner used was having cursor by looping through the source table and replace particular words by other words from another table by matching the words Here is my alternate...
    Posted to Madhivanan (Weblog) by Madhivanan on Fri, Jan 8 2010
  • Happy Holidays

    In the Query Analyser, set the Result mode to Text (Press CTRL+T) and run the following code set nocount on select space ( 17 - len ( replicate ( char ( 94 ), no )))+ replicate ( char ( 94 ), no * 2 - 1 ) from ( select top 10 row_number () over ( order by name ) as no from sysobjects ) as t union all...
    Posted to Madhivanan (Weblog) by Madhivanan on Thu, Dec 31 2009
  • Search a value in character column of all tables

    Sometimes, you may need to find a value in the characters columns (char, varchar, etc) in all the tables This is one of the methods to do it declare @sql varchar ( max ), @search varchar ( 100 ) set @sql = '' set @search = 'your search string' select @sql = @sql + 'select '''...
    Posted to Madhivanan (Weblog) by Madhivanan on Mon, Dec 14 2009
  • Removing unwanted characters - Part 2

    In my previous post about Removing unwanted characters , I posted a method that used a function Here is another method that uses Dynamic SQL declare @data table ( data varchar ( 100 )) -- table that has source data insert @data select 'tes^@&t %stri)-n!g' data union all select '))aaer...
    Posted to Madhivanan (Weblog) by Madhivanan on Wed, Dec 2 2009
  • Parsing a string

    Now-a-days lot of questions are asked in the forum about extracting particular text from a string Here I give some examples on how to do it --Example 1 (Extracting tags and other informations) declare @s varchar ( 100 ) declare @temp table ( id int identity ( 1 , 1 ), data varchar ( 100 )) set @s = '567<a>data<fg>ua<li>test<iu>welcome'...
    Posted to Madhivanan (Weblog) by Madhivanan on Wed, Nov 18 2009
  • Usage of Semicolons in SQL Server

    As you know, semicolon is used as a statement terminator in almost all RDBMSs. However the usage of semicolon is optional in SQL Server except a few cases. Here are atleast the three cases where usage of semicolon is a must 1 At the start of the Common Table Expression (If any statement preceeds it)...
    Posted to Madhivanan (Weblog) by Madhivanan on Tue, Nov 10 2009
  • SQL Server 2008 features that work only in Enterprise Edition

    One of the new features available in SQL Server 2008 is compressed backup which takes backup of a database with mimimum possible size. The syntax is backup database db_name to disk = 'backup_path' with init , compression But this works only in Enterprise Edition of the SQL Server 2008 and not...
    Posted to Madhivanan (Weblog) by Madhivanan on Tue, Nov 3 2009
  • Script out Procedures to seperate files

    In this post script-out-procedures-and-functions-part-2 , I showed how to script out the procedures in a single file Here is another way to do the same but different file for each procedure. The file name will be the name of the procedure. declare @sps table ( proc_name varchar ( 100 ), texts varchar...
    Posted to Madhivanan (Weblog) by Madhivanan on Mon, Oct 26 2009
Page 1 of 7 (66 items) 1 2 3 4 5 Next > ... Last ยป
Powered by Community Server (Commercial Edition), by Telligent Systems