Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 stored procedures with linked servers

Author  Topic 

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2001-11-15 : 21:44:18
hi

i have a small problem i am using cursors open with some condition and then access data from oracle and display the data..

if i am access Sql server
select @nm=reg_name,@add=@address from customer where acctno=@actno

if i am oracle (openquery)
i tried with
set @sql=N'select @nm=reg_name,@add=@address from openquery(starbcc1,"select reg_name,@address from customer where acctno='''
set @sql =@sql + @t1 + '''")'
exec SP_EXECUTESQL @sql
select @nm,@add

i get a error
Server: Msg 137, Level 15, State 1, Line 1
Must declare the variable '@nm'.

am idea to solve it let me know
bye

   

- Advertisement -