_대문 | 방명록 | 최근글 | 홈피소개 | 주인놈
FrontPage › SQLServer에서HTTPCall하기

Contents

[-]
1 방법1: sp_OA어쩌구 프로시저 이용하기
2 방법2: CLR 이용하기


1 방법1: sp_OA어쩌구 프로시저 이용하기 #

구글에서 검색하면 많이 나온다.
뭐.. 그러하다.
/*
exec sp_configure 'show advanced options', 1;  
go  
reconfigure;  
go
exec sp_configure 'Ole Automation Procedures', 1;  
go  
reconfigure;  
go 
*/


declare
    @obj int
,   @response nvarchar(4000)

exec sp_OACreate 'MSXML2.XMLHTTP', @obj out;
exec sp_OAMethod @obj, 'open', NULL, 'get',
                 'https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22USD%22%2C%22KRW%22)&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys',
                 'false'
exec sp_OAMethod @obj, 'send'
exec sp_OAMethod @obj, 'responseText', @response output

select @response

exec sp_OADestroy @obj

2 방법2: CLR 이용하기 #


댓글 남기기..
이름: : 오른쪽의 새로고침을 클릭해 주세요. 새로고침
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2018-04-13 23:12:53

꿈은 용기를 낳고 용기는 기회를 낳는다.