Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. 2005 sql server returns 'Invalid character value for cast specification'

2005 sql server returns 'Invalid character value for cast specification'

Scheduled Pinned Locked Moved C / C++ / MFC
databasehelpquestionc++sharepoint
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    chenggong
    wrote on last edited by
    #1

    Hi, my VC++ 6.0 application calls my check_user_sp stored procedure that calls the sys.sp_helpuser system stored procedure: ----- CREATE PROCEDURE check_user_sp @inp_user VARCHAR(20) AS EXEC sp_helpuser @inp_user ----- I have no problem running the application against database on the 2000 sql server(2000 - 8.00.760), but I get 'Invalid character value for cast specification' error with the same database on the 2005 sql server(2005 - 9.00.1399.06). the sp_helpuser is dated 1996/08/14 10:33 on both 2000 and 2005 server, and I don't get error when exec my get_user_sp in the 2005 sql server management studio. what is 2005 sql server doing to cause this? THANKING FOR YOUR HELP!

    M 1 Reply Last reply
    0
    • C chenggong

      Hi, my VC++ 6.0 application calls my check_user_sp stored procedure that calls the sys.sp_helpuser system stored procedure: ----- CREATE PROCEDURE check_user_sp @inp_user VARCHAR(20) AS EXEC sp_helpuser @inp_user ----- I have no problem running the application against database on the 2000 sql server(2000 - 8.00.760), but I get 'Invalid character value for cast specification' error with the same database on the 2005 sql server(2005 - 9.00.1399.06). the sp_helpuser is dated 1996/08/14 10:33 on both 2000 and 2005 server, and I don't get error when exec my get_user_sp in the 2005 sql server management studio. what is 2005 sql server doing to cause this? THANKING FOR YOUR HELP!

      M Offline
      M Offline
      Mukkie
      wrote on last edited by
      #2

      Hello! try checking database collation settings / server collation settings.

      C 1 Reply Last reply
      0
      • M Mukkie

        Hello! try checking database collation settings / server collation settings.

        C Offline
        C Offline
        chenggong
        wrote on last edited by
        #3

        thanks! I checked and they have the same collation seetings. I looked into the sp_helpuser code and then realized that the one in sql server 2005 returns 7 columns but the one in sql server 2000 returns 6. My application expects 6 columns and gets the error with sql server 2005.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups