in

SQL Server Blogs

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

Browse by Tags

  • DATA ACCESS setting on local server

    When you look at the sys.servers catalog view, you will see list of linked servers defined on the server plus one additional row for the server itself. You can distinguish the local server from linked servers by column server_id, which in case of local server has value of 0. select server_id , name ...
    Posted to Piotr Rodak (Weblog) by Piotr Rodak on Sun, Nov 22 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
  • Makesafe script - set up security for developers

    I worked yesterday on a script that is supposed to run on DEV database after it has been restored from production. This script adjusts configuration data and security in the database so developers can work safely on production data without compromising security policies. The original script has a long...
    Posted to Piotr Rodak (Weblog) by Piotr Rodak on Sat, Oct 24 2009
  • Finding out problematic data in Bulk Insert data truncation error

    Suppose you want to import data from a text file to a table, one of the options is to use Bulk Insert command It allows to import data to the table, though one/more columns don't have enough size to get the maximum length of data from text file.It throws errors about data truncation with line numbers...
    Posted to Madhivanan (Weblog) by Madhivanan on Mon, Oct 19 2009
  • Removing tags from a string

    In http://ask.sqlteam.com , a question was asked about removing the comments from the HTML template The comments have the following pattern {/*}comment{*/} The comments can be nested too The task is to remove all the comments Here is my solution declare @string varchar ( 8000 ) , @data varchar ( 8000...
    Posted to Madhivanan (Weblog) by Madhivanan on Mon, Oct 12 2009
  • DISABLE TRIGGER not captured, SSIS

    This post was to be about behavior of SSIS when they insert rows to tables with triggers on them. We had an issue with one of our packs that began to fail 'all of a sudden'. But when I began writing this post and building test SSIS project and database objects, I came across something even more...
    Posted to Piotr Rodak (Weblog) by Piotr Rodak on Sat, Oct 10 2009
  • Maximum length of each column

    How do I find out the maximum length of each column in a table? Here is the answer declare @sql varchar ( 8000 ), @table sysname select @table = 'your_table' , @sql = '' select @sql = @sql + 'select ''' + @table + ''' as table_name,''' + column_name...
    Posted to Madhivanan (Weblog) by Madhivanan on Thu, Oct 1 2009
Page 3 of 10 (92 items) < Previous 1 2 3 4 5 Next > ... Last ยป
Powered by Community Server (Commercial Edition), by Telligent Systems