How can I set @db_id = to the id that is returned from this query

@P_UID char(15), 
@P_UPWD char(15), 
@P_SRVR_NA sysname, 
@P_SRVR_DB_NA sysname
 
AS
begin
declare  @sql varchar(2000), @DB_ID int
 
set @sql = "select b.id from openrowset('MSDASQL', 'DRIVER={SQL
Server};SERVER="
set @sql = @sql +
@P_SRVR_NA+";UID="+LTRIM(RTRIM(@P_UID))+";PWD="+LTRIM(RTRIM(@P_UPWD))+"',"
SET @SQL = @SQL + @P_SRVR_DB_NA+".DBO.SYSOBJECTS) AS B  WHERE
B.NAME='SOORDER' "
 

set @db_id =  exec(@SQL)
 
end
 
 
 
 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://affiliates.macromedia.com/b.asp?id=2439&p=go/ct_aff1

Message: http://www.houseoffusion.com/lists.cfm?link=i:6:1716
Archives: http://www.houseoffusion.com/lists.cfm?link=t:6
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:6
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=<:emailid:>.<:userid:>.<:listid:>

                        

Reply via email to