Stored procedure using sql server 2005

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sebrina
    New Member
    • Oct 2010
    • 1

    Stored procedure using sql server 2005

    I wrote a stored procedure which do a bulk insert into a table getting data from a text file. The data is inserted into a temp table and the I do an inserto to the original table.

    eg of figures

    " 30125.56 "
    " 237.18-"

    My question is that the minus sign is at the end of the figure. I can't ignore the minus and I have to use money
    Data Type.

    How can I change the " 237.18-" to be " -237.18"

    The minus must be before the figure

    Code:
    CAST(LTRIM(RTRIM(wswt_TotClaim)) AS MONEY),
    CAST(LTRIM(RTRIM(wswt_CurrBal)) AS MONEY)
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32668

    #2
    If you have to use the money data type, and the data isn't recognised as signed with the '-' at the end, then surely you should be looking at the creation of the data. Otherwise, I guess you'd be reading the data in as a string and fiddling about with it from there. Pretty messy I would expect.

    Comment

    Working...