Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Please; cant change table size

Status
Not open for further replies.

comtec

Technical User
Oct 19, 2002
17
0
0
CA
I have a web form inputing to a description table field using a SP
I need more data in the field so i went to the sp and changed from varchar(256) to varchar(500) for the field

I then went directly to the table and changed the same thing the same thing. varchar(256) to varchar(500)

I have rebooted everything thinking someting was not resetting but no luck

There do not seem to be any limiting issues with the simple asp update code

The error being returned to the asp page is as follows and has not changed even after I changed the parameters of the field

3421 - Application uses a value of the wrong type for the current operation.
In Call Stored Procedure

I have gone back through everything and cannot discover the issue

Thanks in advance



Paul D
dontneednew.com
 
What command are you using to change the lenght? This is what you should be using:

ALTER TABLE table_name ALTER COLUMN mycolumn VARCHAR(500)


-SQLBill
 

I change it from the query analyser for sql server and with enterprise manager for the table.

It seems to have changed it ok both view with new settings

just doesnt work when I run it
If I keep my size under the original 256 then it is fine
something is not swithcing values
the problem declare below is iDes
it was set to 256
the value has been changed in the table field as well

copy of properties from table:
( 1 ItemDescription varchar 500 1)

copy of sql statement :

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

/****** Object: Stored Procedure dbo.sp_XML_Dealer_Edit_Item_Set Script Date: 8/27/2003 9:57:45 AM ******/

/****** Object: Stored Procedure dbo.sp_XML_Dealer_Edit_Item_Set Script Date: 8/27/2003 7:56:59 AM ******/

/****** Object: Stored Procedure dbo.sp_XML_Dealer_Edit_Item_Set Script Date: 8/27/2003 7:44:31 AM ******/



ALTER PROCEDURE dbo.sp_XML_Dealer_Edit_Item_Set

@SID int,
@WID int OUTPUT,
@Cond varchar(25) OUTPUT

AS
BEGIN
DECLARE @IDes varchar(500)
DECLARE @EP money
DECLARE @PID int
DECLARE @PN2 varchar(30)

SELECT @IDes = ItemDescription, @EP = EstimatePrice, @PID = ProductID, @WID = WarrantyID, @Cond = Condition, @PN2 = PartNumber2 FROM StockItems WHERE StockItems.StockItemID = @SID
IF @@Error <> 0
GOTO On_Error

SELECT i.ItemDescription AS IDes, i.EstimatePrice AS EP, i.Condition AS Cond, i.WarrantyID AS WID, i.w_Name AS WName, i.PartNumber2 AS PN2,
s.StockItemID AS SID, s.DealerSKU AS DSKU
FROM vInstockItems i INNER JOIN
StockItems s ON s.ProductID = i.ProductID
WHERE s.ItemDescription = @IDes AND
s.ProductID = @PID AND
s.EstimatePrice = @EP AND
s.WarrantyID = @WID AND
s.Condition = @Cond AND
s.PartNumber2 = @PN2 AND
s.ItemStatusID = 1 AND
i.ItemDescription = @IDes AND
i.ProductID = @PID AND
i.EstimatePrice = @EP AND
i.WarrantyID = @WID AND
i.Condition = @Cond AND
i.PartNumber2 = @PN2
FOR XML AUTO
RETURN(@@Error)

END
On_Error:
RETURN(@@Error)


GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO



Paul D
dontneednew.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top