set @sSQL='Insert into #tempBusDetails(Bus_Route_ID ,Bus_Route_Name ,Vehicle_No,Max_Occupacy,
Current_Occupacy ,Driver_Name ,Driver_Mobile_No ,Assistant_Name ,Assistant_Mobile_No,Hub_ID,HTML_StopName)
SELECT distinct(bd.Bus_Route_ID),bd.Bus_Route_Name, bd.Vehicle_No, bd.Max_Occupacy, dbo.Current_Count(bd.Bus_Route_ID) AS User_Count, bd.Driver_Name,
bd.Driver_Mobile_No,bd.Assistant_Name, bd.Assistant_Mobile_No, f.Facility_Name, dbo.fnc_CreateHTML_StopName(bd.Bus_Route_ID) AS HTML_StopName
FROM dbo.tbl_Bus_Details AS bd
INNER JOIN dbo.tbl_Facility AS f ON bd.Hub_ID = f.Facility_ID
INNER JOIN dbo.tbl_stop_details as sd on sd.Bus_route_id=bd.bus_route_id
WHERE bd.Inactive='+cast(@Inactive as varchar)+ ''
I have a doubt in the quotation mark(in the last line).
--> WHERE bd.Inactive='+cast(@Inactive as varchar)+ ''
-->is it like bd.Inactive=' (This quotation is end of start quote). If yes then why do we need the last two quotes(+ '').
-->or is it like this is wrapped in single quotes : '+cast(@Inactive as varchar)+ '. And the final quotation is closed for start quote.
Kindly guide me.