﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Ian Stirk  / Error when executing the procedure / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 25 May 2013 09:37:06 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Error when executing the procedure</title><link>http://www.sqlservercentral.com/Forums/Topic592805-1358-1.aspx</link><description>i was using this sql in prod environment.i also got the same error invalid length error in substring.i gave a try catch block inside the sp.why this error comes ?</description><pubDate>Wed, 01 Jul 2009 02:14:42 GMT</pubDate><dc:creator>vasanth-257691</dc:creator></item><item><title>RE: Error when executing the procedure</title><link>http://www.sqlservercentral.com/Forums/Topic592805-1358-1.aspx</link><description>Very nice, now if i could just get everbody here to get off of sql 2000 i would be set</description><pubDate>Tue, 28 Oct 2008 13:06:26 GMT</pubDate><dc:creator>danschl</dc:creator></item><item><title>Error when executing the procedure</title><link>http://www.sqlservercentral.com/Forums/Topic592805-1358-1.aspx</link><description>Nice script.  While running this proc during a particular index rebuild, I get the following error:---Msg 536, Level 16, State 5, Procedure dba_WhatSQLIsExecuting, Line 17Invalid length parameter passed to the SUBSTRING function.---The sql I was running was:---USE [BI_DW]GO/****** Object:  Index [idx_FXT_WHSE]    Script Date: 10/28/2008 07:29:21 ******/IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[fact_Forecast]') AND name = N'idx_FXT_WHSE')DROP INDEX [idx_FXT_WHSE] ON [dbo].[fact_Forecast] WITH ( ONLINE = OFF )/****** Object:  Index [idx_FXT_WHSE]    Script Date: 10/28/2008 07:29:39 ******/CREATE NONCLUSTERED INDEX [idx_FXT_WHSE] ON [dbo].[fact_Forecast] (	[WAREHOUSE_KEY] ASC)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = OFF) ON [PRIMARY]---If I comment out the column with the substring, the procedure runs again.  Any ideas?Thanks.</description><pubDate>Tue, 28 Oct 2008 06:37:53 GMT</pubDate><dc:creator>Darren Lacy</dc:creator></item></channel></rss>