SELECT @ihotelID= [hotelID] , @ihotelCode = [hotelCode], @iroomTypeCode = [roomTypeCode] ,@dcratePerNight=[ratePerNight],
@iroomid =[roomid],@inoOfRooms =[noOFRooms],@Datefrom=toDate,@sstatus=status,@specialday='No',
@dcb2BPercentage=[b2BPercentage],@dcb2CPercentage=[b2CPercentage],@sadditionalBenefits=[imgBenefits]
FROM (SELECT ROW_NUMBER() OVER(ORDER BY hotelID) AS 'RowNo' FROM RoomDetails1 t1)
答案 0 :(得分:1)
您正在尝试选择子查询未返回的字段(仅返回RowNo)。
尝试例如:
SELECT ROW_NUMBER() OVER(ORDER BY hotelID) AS 'RowNo', [hotelID] ,[hotelCode],........
FROM RoomDetails1 t1
对于演示,我已将字段值的分配删除为变量 - 只是为了明确更改的内容