-
Dynamic sequel statements...
Hi all,
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),
@SQLStr varchar(500),
@Agent_id int,
@NetworkId_nm varchar(30)
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)
print @SQLStr
-- 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))
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
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
|
Bookmarks