Help with syntax

  • Error: conversion failed when converting the varchar value '","' to data type int

    select '"'+[ssn]+'","'+ [username]+'","'++'","'+[estatement]+'","'+ CAST([billpay] AS varchar(12))+'",'from @people

  • You need to CAST another column to varchar, since it's an int, as was done with billpay:

    select '"'+cast([ssn] as varchar(11))+'","'+ [username]+'","'++'","'+cast([estatement] as varchar(100))+'","'+ CAST([billpay] AS varchar(12))+'",'from @people

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • thank you so much!

    Shelley

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply