magix
3/28/2007 6:38:00 PM
If I have following, but can I just SET the variable for string like : SET
@FullName = @vName1
It return syntax error. How can fix it ?
DECLARE
@vName1 varchar(100),
@vName2 varchar(100),
@FullName varchar(100),
SELECT Name2, Name2 FROM myRecord
OPEN dCursor
FETCH NEXT FROM dCursor INTO @vName1, @vName2
WHILE ( @@fetch_status <> -1 )
BEGIN
IF LTRIM(RTRIM(@vName1)) <> '' OR LTRIM(RTRIM(@vName1)) IS NOT NULL)
BEGIN
SET @FullName = @vName1
END
ELSE
BEGIN
SET @FullName = @vName2
END
....
.... and so on.