Hi ,
I have an requirement for SP in Sql Server
If Agent.FirstName and Agent.LastName in Agent_Hierarchy is Null Then' I need to Pick
Agent.FirstName and Agent.LastName from hagent of Different Data base. The below is my Code but i am unable to get the result
Any one can find soln..
CREATE PROCEDURE [dbo].[WIN_IdleHoursAgent]
(
@StartDate AS SMALLDATETIME
)
AS
DECLARE
@SQL VARCHAR(MAX)
@AgentName VARCHAR(MAX)
SET @AgentName=ISNULL(AH.Agent_LastName,[CS_RAW_DATA].[dbo].[hagent].[Item_Name]) AND ISNULL(AH.Agent_LastName,[CS_RAW_DATA].[dbo].[hagent].[Item_Name])
SELECT @AgentName=@AgentName
BEGIN
SET @SQL = '
SELECT @AgentName As Agent_Name,
x.LogId As Agent_Id)x LEFT JOIN [WEDW].[dbo].[Agent_Hierarchy] AS AH
END
Join Hands Change lives
Thanks & Regards
Straight Edge Society