SQLSERVER 2005 batch file into the database from

Date Open High Low Close Volume Turnover

WHILE @ @ FETCH_STATUS = 0
– all of the stock price into the temporary table
StockPrice.xml file:
GO
FROM OPENROWSET (BULK #39;D: \ Merchants Securities accessible information \ T0002 \ export \ CASE WHEN @ StockCode LIKE % THEN H ELSE Z END @ StockCode TXT #39;, FORMATFILE = #39;D: \ StockPrice. xml #39;) AS t1
< br /> FETCH NEXT FROM CUR_TMP INTO @ StockCode;

Step Three:
SELECT @ SQL = lt;br /> – define a list of current stock market cursor
END

D: \ StockPrice.xml defined xml file


D: \ Investment Securities Mastery letter \ T0002 \ export \ SZ000001.TXT is the data source file path
StockCode, TradingDate, [Open], [Close], High, Low, Volu me, Amount

– per share to take the first right to re-price
CLOSE CUR_TMP;
OPEN CUR_TMP;
Sql server2010-09-21 09:19:08 Read 2 Comments 0 Word Count: Example: The 1892 stock price into the database, format: a stock accessible information from a senior export file Export data formats (non-data line skip)
FROM OPENROWSET (BULK : \ Merchants Securities Mastery letter \ T0002 \ export \ SZ000001.TXT FORMATFILE = : \ StockPr ice.xml AS t1

FETCH NEXT FROM CUR_TMP INTO @ StockCode;

key statement:
INSERT INTO tempdb.dbo.StockPriceForward (



< FIELD ID = "2" xsi: type = "CharTerm" TERMINATOR = "\ t" MAX_LENGTH = "41" />
DEALLOCATE CUR_TMP;

as follows
)
INSERT INTO information.StockPriceForward (
Step 1: According to the data source file defines an XML file



the temporary table data into the target
DECLARE @ StockCode nvarchar (6), @ SQL nvarchar (max);
SELECT 00001 TradingDate, [Open], [Close], High, Low, Volum e / 100, Amount
BEGIN
TRUNCATE TABLE information.StockPriceForward;
EXEC (@ SQL);
can be achieved using the cursor to import all of the stock price,
Step two:
FROM information.uv_Stock
2010 年 09 月 21 日
SELECT #39; StockCode #39; TradingDate, [Open], [Close], High, Low, Volume/100 , Amount
DECLARE CUR_TMP CURSOR LOCAL FAST_FORWARD FOR
for the environment: the price is updated daily, before the right to re-price more special, know that the stock of knowledge should know, such as a stock sent shares after the price of the previous need a fresh calculation again.

WHERE IssuingDate IS NOT NULL AND ListingDate IS NOT NULL AND DelistingDate IS NULL;
2008-01-02 22.09 22.96 21.59 22.32 13158390 709842240.000
2008-01-03 22.09 22.32 20.65 2 SMS credit card fraud due to the new annual fee bait 1.19 21134656 1065804736.000
StockCode, TradingDate, [Open], [Close], High, Low, Volu me, Amount
data source:


Create a job, you can bulk import data, daily from accessible information to do is download the latest software on the stock ex-dividend data.

as SZ00001.TXT …..

SELECT StockCode
)

No comments allowed