Hi,
I am getting the following error while I am trying to execute the following query..
'Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.'
DECLARE @UserId INT
DECLARE @OriginatorId Varchar(16)
SET @UserId=7516
SET @OriginatorId=33647
INSERT INTO dbo.tblAccount
(
UserID_Created , UserID_Assigned ,OriginatorID , OrigAccountID , AccountName , StatusTypeID ,DateCreated , AccountTypeID ,OnlineID ,
IsLockedForOffline ,
ConvertedByUserID , DateConvertedFromLead ,ExternalAccountID
)
SELECT @UserId,@UserId,@OriginatorId,FileKey,'Account '+CAST(FileKey AS VARCHAR),-1,GETDATE(),972, -1, 0, null,NULL,NULL
FROM dbo.ApplicantDetails
GROUP BY FileKey
having FileKey IN ('8','9')
Can anyone help?
Thanks
Nasif