Little-Big problem with SQL' Update/Set

Results 1 to 2 of 2

Thread: Little-Big problem with SQL' Update/Set

  1. #1
    TheFink Guest

    Default Little-Big problem with SQL' Update/Set

    Hi,<BR>I hope that some of you have a quick answer for me on this. I suppose that this problem is simple to solve but it give me an hell of an headache right now. Here we go:<BR><BR>I&#039m using this Stored Procedure to update a TEXT FIELD in a SQL database:<BR><BR>CREATE PROCEDURE SPUpdateDepName @DepID int, @DepName varchar(20) <BR>AS <BR>UPDATE DepartmentNames SET DepartmentNames.DeNa = @DepName<BR>WHERE (DeID = @DepID)<BR><BR>As you can see. Very basic code. When the first character of the string is a number or any kind of character who is not in the A to Z range, the program throw my this message in the face after trying to enter "2aaaaaa":<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e14&#039 <BR><BR>[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near &#039aaaaaa&#039. <BR><BR>Please help me! :)<BR>Thanks<BR>

  2. #2
    Rob Guest

    Default Try CStr

    When you&#039re passing the variable to the Stored Procedure try....<BR><BR>CStr(variable)<BR><BR>Regards,<BR>R ob

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts