2011-03-11 75 views

回答

5

轉換所有非字符串變量字符串,然後CONCAT ......

SET @Strcat = Convert(varchar(50), @OBID) +','+ Convert(varchar(50), @CursorODID) +','[email protected] +','[email protected] 
+1

不要忘記保持@Strcat的長度來接受所有的變量值,否則你會得到trimed結果。 – Chris 2011-03-11 06:23:09

0

您需要先將其轉換爲nvarchar/VARCHAR:

@OBID int, 
@ODID int, 
@EMID int, 
@TYPE varchar(20), 
@LastModifiedBy int 

SET @Strcat = CONVERT(nvarchar,@OBID) +','+ CONVERT(nvarchar,@CursorODID) +','[email protected] +','[email protected] 

問候