SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Error when executing the procedure


Error when executing the procedure

Author
Message
Darren Lacy
Darren Lacy
SSC Rookie
SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)

Group: General Forum Members
Points: 33 Visits: 51
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.



danschl
danschl
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2100 Visits: 644
Very nice, now if i could just get everbody here to get off of sql 2000 i would be set



vasanth-257691
vasanth-257691
Grasshopper
Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)

Group: General Forum Members
Points: 13 Visits: 75
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 ?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search