Create SQL Server stored procedure with stock data -
I am trying to turn on some code, which is in a stored procedure with those standards from SQL Server What I can pass, but I'm not sure how to do this I need to have 4 variables of the letter stock symbols to be different so that I can pass through different symbols, to work as a cached procedure This code is also required for.
GOOG
is the place where I need the variable.
'
- Announced RSS Feeds @ DoctorHandle INT; DECLARE @ xmlData XML; DECLARE @URL NVARCHAR (255); DECLARE @ fileNVARCHAR (255); DECLARE @ CMD NVHAR (255); DECLARE @sql NVARCHAR (255); DECLARE @tXML TABLE (Data XML); SET @URL = 'http://finance.yahoo.com/webservice/v1/symbols/GLUU/quote'; SET @file = 'c: \ temp \ quotes.xml'; - Downloading data @ CMD = 'C: \ windows \ system32 \ WindowsPowerShell \ v1.0 \ PowerHold (New Object System .Net WebClean). Download file ('' + + @URL + '', '+' file '' '') 'Accelerate Master Debian.xp_cassache @ cmd, no-output - xml variable SET @sql =' Downloaded file loader openOver Choose from (Bulk "+ + File" "," SINGLE_BLOB) as an 'INSERT @tXML EXEC (@sql); SELECT @xmlData = @TXML Data - XML Variable Preparation of Relational Table with EXEC SP_xml_preparedocument @docHandle OUTPUT, @xmlData; Select INSERT in Tblstockdata ([name], [value], [symbol], [ts], [type], [volume] * with OPENXML (@docHandle, N '// list / resource / resource') (Name VARCHAR (10) 'field [@ name = "name"]', value VARCHAR (10) 'field [@ name = "value"]', symbol VARCHAR (10) 'field [@ name = "symbol"] ', VS.AR (10)' field [@ name = "volume"], 'TS VARCHAR (10)' field [@name = "ts"] ', type VARCHAR (10)' field [@ name = "type"] ' ];); EXEC sp_xml_removed document @docHandle;
Thanks!
:)
you The lull part is the lull, which has worked.
As
create process & lt; Schema & gt; & Lt; Name & gt; (@Palam & lt; typing & gt; / P> end
and you will be good to go. For the beginning you have dbo
You can use it as the value of & lt; schema & gt;
unless you need to use a non-default schema. It is recommended that you enter the name of your process name Do not use the prefix "SP" or "XP" because these systems and extended processes are identified by SQL Server
If you need additional parameters then they can be added in the parameter list using a comma as delimiter.
Comments
Post a Comment