我在存储过程中修改了我的SELECT
语句,以使其“Ticket”列包含指向某些javascript操作的超链接,但它给出了错误Invalid Column Name Ticket
Set @SQL = 'Select ''<a href=' + CHAR(39) + 'javascript:editTicketByIDAction(' + CONVERT(VarChar(Max), Ticket) + ')' + CHAR(39) + '>' + CONVERT(VarChar(Max), Ticket) + '</a>'' Ticket,VendorTicket[Vendor Ticket],Comments From dbo.VendorTickets Where NotifyOn <= GetDate() And IsNull(NotifyOn,0)<>0 '
答案 0 :(得分:1)
这应该是
DECLARE @SQL varchar(250)='Select ''<a href="javascript:editTicketByIDAction('' + CONVERT(VarChar(Max), Ticket) + '')">'' + CONVERT(VarChar(Max), Ticket) + ''</a>'', Ticket,[Vendor Ticket],Comments From dbo.VendorTickets Where NotifyOn <= GetDate() And IsNull(NotifyOn,0)<>0 '