in

SQL Server Blogs

Voices from the UK SQL Server Community
All Tags » T-SQL (RSS)

Browse by Tags

  • on update cascade...

    When you define a foreign key constraint, you can also decide what SQL Server should do when primary key to which the constraint references to gets deleted or updated. While I always knew and imagined that ON DELETE CASCADE may be useful, I wondered, what scenarios would be suitable for ON UPDATE CASCADE...
    Posted to Piotr Rodak (Weblog) by Piotr Rodak on Thu, Sep 24 2009
  • Dropping all temp tables

    In SQL Forum one of the posters asked a question about dropping all the temporary tables There are many ways to do this One of the ways to to run the following code declare @sql varchar ( 8000 ) set @sql = '' select @sql = @sql + ' drop table ' + name from tempdb .. sysobjects where xtype...
    Posted to Madhivanan (Weblog) by Madhivanan on Fri, Sep 18 2009
  • Cursor statuses

    Here are the queries that findout the cursors based on their statuses 1 Find out the cursors that are allocated but not opened or closed --Method 1 select name from sys.dm_exec_cursors ( 0 ) where is_open = 0 --Method 2 select cur . cursor_name from sys.syscursorrefs as ref inner join sys.syscursors...
    Posted to Madhivanan (Weblog) by Madhivanan on Tue, Sep 8 2009
  • Generate Fibonacci series - No loop, no recursion

    Generating the Fibonnaci series generally involves in writing the code which has while loop or a recursive function Peso posted the code using the Common table expression Here are my methods that involve no loop or no recursion 1 Use Quirky update technique declare @fib table ( fib_id bigint , fib_val...
    Posted to Madhivanan (Weblog) by Madhivanan on Tue, Sep 1 2009
  • How to Generate Script along with Data?

    One of the new features available in SQL Server 2008 is scripting the tables along with data (in the form of INSERT statements). Here are the useful links that can help you generating script with data SQL Server 2008 http://www.kodyaz.com/articles/sql-server-script-data-with-generate-script-wizard.aspx...
    Posted to Madhivanan (Weblog) by Madhivanan on Fri, Aug 21 2009
  • How to display detailed data below each header data?

    One of my friends asked me if it possible to generate Detailed data for each Header data without using a Cursor or while loop. (The output is something like the one usually seen via reporting tool). He wanted the result to be output to text file Consider the jobs and employee tables from pubs database...
    Posted to Madhivanan (Weblog) by Madhivanan on Thu, Aug 6 2009
  • Regular expression

    One of the posters asked a question in the forums about finding a number in an expression consists of alphabets and number if a particular digit is provided Consider the following set of data this is test place located at no 123456 test foo 35234 bar 126831 72348707 foo foo 987654 bar If the digit provided...
    Posted to Madhivanan (Weblog) by Madhivanan on Mon, Aug 3 2009
  • Command Prompt shortcuts to open SSMS

    Here are the Command Prompt shortcuts to open Enterprise Manager/Management Studio SQL Server 2000 isqlw SQL Server 2005 sqlwb SQL Server 2008 ssms
    Posted to Madhivanan (Weblog) by Madhivanan on Mon, Jul 20 2009
  • Sql release builder

    For a number of weeks, we have been regularly releasing code to our UAT database. The release process of database code differs slightly from releasing binary code because the release has to take into account existing data and schema in the database. With binary code (as in C# application) usually old...
    Posted to Piotr Rodak (Weblog) by Piotr Rodak on Mon, Jul 20 2009
  • CTE in a View

    It is possible to use Common Table Expression in a View. But newbies wonder why the following is not possible create view numbers as with numbers ( n ) as ( select 1 as n union all select n + 1 from numbers where n < 10000 ) select n from numbers option ( maxrecursion 0 ) Which when created results...
    Posted to Madhivanan (Weblog) by Madhivanan on Sat, Jul 11 2009
Page 4 of 10 (92 items) « First ... < Previous 2 3 4 5 6 Next > ... Last »
Powered by Community Server (Commercial Edition), by Telligent Systems