Forum Replies Created

Viewing 5 posts - 31 through 35 (of 35 total)

  • RE: EXEC sp_executesql issue with my group clause

    Ok, I ran some tests in 2005 and confirmed that you can not pass fields or tables values in parameters for sp_executesql in 2005. If you try and pass...

  • RE: EXEC sp_executesql issue with my group clause

    I don not believe you can pass table or a column names as a parameters to sp_executesql in 2005, but you must interpolate it into the SQL string as I...

  • RE: EXEC sp_executesql issue with my group clause

    Try this

    CREATE TABLE #TEST (ID Bit)

    INSERT INTO #TEST VALUES (1)

    DECLARE @TestSQL nvarchar(Max), @sql nvarchar(Max), @Parameters nvarchar(Max)

    SET @TestSQL = 'ID'

    SET @sql = 'SELECT '+@TestSQL+' FROM #TEST...

  • RE: Field length mismatch

    If you are sure that all the extra characters are an ascii code 160 then you can use replace before the trim like this.

    insert into dbo.cc_codes (numcode,phonecode)

    select numcode,cast(rtrim(ltrim(replace(phonecode,char(160),''))) as smallint)...

  • RE: Finding sets of records

    this should work as well and would allow you to bring back other fields from the tblCase table

    Select A.CaseID

    from dbo.tblCase A

    ...

Viewing 5 posts - 31 through 35 (of 35 total)