Viewing 5 posts - 31 through 35 (of 35 total)
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...
December 30, 2009 at 7:08 pm
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...
December 30, 2009 at 4:14 pm
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...
December 30, 2009 at 1:32 pm
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)...
December 30, 2009 at 9:36 am
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
...
December 29, 2009 at 10:05 pm
Viewing 5 posts - 31 through 35 (of 35 total)