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.
Author |
Topic |
dbodenheimer
Starting Member
1 Post |
Posted - 2007-07-23 : 07:04:09
|
This has got to be really simple, but I am sure struggling with it. I have the following spCREATE PROCEDURE test1 (@lpn nvarchar(255),@Shp nvarchar(50) out,@Cnt nvarchar(50) out)ASDECLARE @StrSQL nvarchar(400)SELECT @StrSQL = N'SELECT * FROM OPENQUERY(chpw9,''SELECT SSCC_CARTON_I,SHP_LBL_FMT_CD,SHP_CLPS_FMT_CD FROM TB_Label WHERE SSCC_CARTON_I= ' + @lpn + ''')'exec(@strsql)GOI need to return the values from the query. Nothing I do seems to work.Help me out????Thanks!Dave |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-07-23 : 07:18:11
|
Read about sp_executesql in Books Online and you will figure it out.Peter LarssonHelsingborg, Sweden |
 |
|
|
|
|