Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Error when executing the procedure Expand / Collapse
Author
Message
Posted Tuesday, October 28, 2008 6:37 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, March 11, 2014 1:55 PM
Points: 33, Visits: 48
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 17
Invalid 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.



Post #592805
Posted Tuesday, October 28, 2008 1:06 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, October 25, 2013 7:43 AM
Points: 1,384, Visits: 644
Very nice, now if i could just get everbody here to get off of sql 2000 i would be set



Post #593190
Posted Wednesday, July 01, 2009 2:14 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, September 12, 2011 10:03 AM
Points: 13, Visits: 73
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 ?
Post #745160
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse