Dynamic sequel statements...
I have two dynamics sequel statements. One is work and the other not work.
If I declare @SqlStr and put the statements then it works and when I use
Execute(...) then not. I am try to convert @Agent_id to varchar(20) and
rtrim it. Any helps would greatly appreciate.
-- #1 Work O.K..
declare @dbname varchar(128),
set @dbname = 'Janb'
set @Agent_id = 70
set @NetworkId_nm = 'Nguyenl02'
set @SQLStr = @dbname + '.dbo.' + 'IpAgentInfo @Agent_id = ' + CAST(RTRIM(@Agent_id)
AS VARCHAR(20) ) + ', @NetworkID_nm = ' + RTRIM(@NetworkID_nm)
-- Janb.dbo.IpAgentInfo @Agent_id = 70, @NetworkID_nm = Nguyenl02
-- #2 NOT work and cannot figuire out why...
EXECute (@dbname + '.dbo.' + 'IpAgentInfo @Agent_id = ' + RTRIM(CAST(@Agent_id
AS VARCHAR(20)) ) + ', @NetworkID_nm = ' + RTRIM(@NetworkID_nm))
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL