T-SQL (SS2K8) :: Import Data From XML Feed To Get Daily Exchange Rates
Aug 26, 2015
I'm trying to find a way to import data from this data xml feed to get daily exchange rate. I' tried:
select *
from
openrowset(bulk 'http://www.bankofcanada.ca/stats/assets/xml/fx-noon.xml',single_blob) as x
Which is a feeble attempt at a start; however, am getting this error message:
Cannot bulk load because the file "http://www.bankofcanada.ca/stats/assets/xml/fx-noon.xml" could not be opened. Operating system error code 123(The filename, directory name, or volume label syntax is incorrect.).
How to parse this file using SQL.
View 1 Replies
ADVERTISEMENT
May 29, 2008
Hi,
I have this specific problem, that has been causing me alot of headaches for the last couple of days, and I can't seem to fiure it out on my own.
Basically i am working on a many to one currency conversion setup, where I have a fact table with exchange rates for periods and for all input currencies. The reporting currency is USD. Here is a demonstration of the data in it:
Valid Date Source Currency Rate
2008-01-01 GBP 2.0563
2008-01-01 EUR 1.4634
2008-04-01 GBP 1.9968
2008-04-01 EUR 1.5197
Normal period by period conversion is easy enough, but I want to convert the measures at the latest known rate, based on the period selected. Lets say I run an analysis without slicing on time, then it want it to convert at the last entered rate of all time, and if the user wants to run the analysis as of March 08, then it should convert all data to the rate as of January, since this is the latest one known.
I have tried to set the measure to a semi-additive behaviour, with "lastnonempty", but the problem with that is the conversion over time. Here is an example:
I want to show a measure summed "all to date" as of June 08. What I want is it to convert everything at the rates entered in April 08, but what I get is that it convert everything up until Jan 08 and the rates entered in January, and thereafter it starts to use the rated entered in April.
Period Amount LCY Currency Code Exchange Rate
Dec 07 100 GBP 2.0563 (Wrong, should be 1.9968)
Dec 07 100 EUR 1.4634 (Wrong, should be 1.5197)
Jan 08 100 GBP 2.0563 (Wrong, should be 1.9968)
Jan 08 100 EUR 1.4634 (Wrong, should be 1.5197)
Feb 08 100 GBP 1.9968
Feb 08 100 EUR 1.5197
Mar 08 100 GBP 1.9968
Mar 08 100 EUR 1.5197
Apr 08 100 GBP 1.9968
Apr 08 100 EUR 1.5197
May 08 100 GBP 1.9968
May 08 100 EUR 1.5197
Jun 08 100 GBP 1.9968
Jun 08 100 EUR 1.5197
How do I create a measure containing the latest known rates based on time selection?
Thanks in advance
View 2 Replies
View Related
Apr 23, 2015
I have created a spreadsheet using powerquery and powerpivot. Loading the data on powerquery from different spreadsheets was a charm, the problem is calculating the exchange rates per month.The structure is as following:I have 3 tables, they are:
Dates– Just a dates (loaded directly on PowerPivot).
Invoice – Details of invoices for all customers, gross totals are in different rates (loaded through power query)
Customer – Detailed information of customers (loaded directly on PowerPivot).
Currency – exchange rates (loaded directly on PowerPivot).
Note: I mentioned where they were loaded because I do not know if that really matters, I guess it does not... but extra information will not hurt. Now, let's go to how these tables are connected between each other and their key columns.The Invoice table has information on invoices dates, invoice gross total and customer code. This table is related to Customer table, which has the actual name of customers and other details. This link is done through the Customer Code column. The Currency table have a relationship with the Customer Table through the Country Column.
What I want to achieve is a formula to do the exchange rate based on the Invoice Date column present on the Invoice Table. So I have created a column on the Currency Table named at each month of the year and populated it with the exchange rates for all countries (countries listed using ISO3 format).My problem is while I am able to select a column from the Currency table to do the exchange rate calculation using the below formula, I fail to realize how to do it per month:=CALCULATE(sum(invoice[Gross Value])*SUM(Currency[Reverse]))*Reverse is the column with the exchange rate for the country money to USD.What I am failing to do is how to make that calculation to also consider the month of the invoice and pull the exchange rate for the same month from the Currency table
Get the invoice date then find the column on Currency[Month] and multiply, providing me the USD amount.I was unable to figure out a solution using the filters parameters from Calculate. If some of you ask why I am using SUM inside Calculate, is because if I only use SUM and try to do the math between the two tables I get an error saying that it was not possible to determine the value on Currency[Reverse]. Same happens with SUMX. It worked out with Calculate, but then I cannot create other formulas using CALCULATE on that table because it will give that error on redundancy, unless I add a filter on it, which worked last time (but I do not remember which thing /parameter used to filter, so do not ask it right now.I do not really need that level of accuracy, but my Virgo perfectionist side demands me to find a solution to that, that will not use a single exchange rate, but consider which is the correct exchange rate for the month of the invoice and calculate it correctly for all invoices. Just so you know, the Invoices tables has more than 1million lines.
View 3 Replies
View Related
Jun 13, 2014
I have a task to provide users with a list of currency rates in the following format:
Base Currency
Hedged Currency
Base to Hedge Rate
Hedged to Base Rate
E.g.
"Base Currency"..."Hedged Currency"..."Base to Hedge Rate"..."Hedged to Base Rate"
GBP....................USD.......................1.70.........................0.59
GBP....................EUR.......................1.25..........................0.80
(the dots are for the visual only)
The table I have been provided in SQL has the following structure:
Currency Code
Currency Rate (Rate against the Base Currency)
Base Currency (BIT to recognise which currency is the base one as it can vary from site to site. Only once currency can be Base per a given site)
I have started to implement, but ended up with cursor and temporary table, where I insert the data.
View 3 Replies
View Related
Oct 4, 2000
Import Exchange into SQL Server with DTS?
Our users enter data into the MS Exchange database using custom Outlook forms. We want to import that data in SQL Server using SQL Server Data Transformation Services (DTS). We do not see Exchange in the Data Source list in the DTS wizard. Is there an easy way to do this? Maybe an OLEDB provider for Exchange?
Thanks,
Bob
View 1 Replies
View Related
May 19, 2015
I routinely need to import data into SQL DB from Access 2010.I've tried using both Openrowset and Opendatasource, and I'm receiving similar errors.
Here's my code I'm trying:
SELECT *
FROM OpenRowset('Microsoft.Jet.OLEDB.4.0','C:ITS DatabaseCHI_ITS_v2013a.accdb';'admin';'',Sheet2)
Here's the error message I'm receiving:
Msg 7308, Level 16, State 1, Line 1
OLE DB provider 'Microsoft.Jet.OLEDB.4.0' cannot be used for distributed queries because the provider is configured to run in single-threaded apartment mode.
View 1 Replies
View Related
Jul 14, 2015
I have a problem that requires me to write Daily sum aggregation script, I wrote the script; But what I'm not sure of is the "Daily" part, my script will give me only give me results when I execute it. How to make this code daily?
SELECT
Receipt
,"Date"
,Item
,Reason
,Division
,SUM(Cost) AS Cost
[Code] ......
View 1 Replies
View Related
Jul 9, 2004
hi, my company needs to import 3 access or excel ,customer order table, into
ms sql database daily.orders(basic customer info), items(product info and quanity), options (options of quantity). The problem is that 3 table has to get additional column when it is imported into sql. For example, when an order comes in its intranet application, it will keep track if it is in stock or out of stock checking the product table. those 2 databases ms sql and access or excel has identical columns but sql one has more in addition . This is my first time to work this kind of case and if somebody could give me a abstract step or suggestions to accomplish this.I'll be very happy;)
Thanks
kiss
View 1 Replies
View Related
Mar 18, 2015
I setup data collection on a production server to capture growth rates.
When I run the dis usage report, it shows a daily growth rate of over 500 megs. This seems excessive to me.
As a troubleshooting step I then ran sp_space used and got these results:
database_namedatabase_sizeunallocated space
rgc_prod 273442.63 MB3648.48 MB
reserved data index_size unused
265345488 KB164385384 KB99826072 KB1134032 KB
What should my next steps be to try and determine why there is so much growth? And isn't the index size rather large?
View 1 Replies
View Related
Mar 12, 2004
Hello Friends,
I would like to know what Data Feed means while working as an Administrator on Ms SQL Server 2000?
Also what do you mean by integrating feed of data?
I would appreciate it if anyone could help me out with this queries...
Also I was wondering which would be best book to refer while learning about ms sql server 2000.
View 6 Replies
View Related
Dec 29, 2005
Hello,I have an XML data feed that I would like to use to create tables inSQL Server. The xml data feed consists of a large amount ofinformation that changes on a regualar basis. Is there a way toautomatically create SQL Server tables using the data feed?ThanksBilly
View 7 Replies
View Related
Jun 13, 2001
I need to have an automated process to read data from DB2/AS400 and feed it to SQL Server 2000. Has anyone done this before? Any suggestions how it may be done? I know my company doesn't want to spend a lot to do this.
Thanks for your time.
View 2 Replies
View Related
Mar 23, 2007
Does anyone know where to start if I want an exported copy of homeappliances, cars, cell phones etc.I just need to populate my database and I want to get some data feedfrom all the different types of manufactures.I think there are services out there. But I have not seen one.I want a CSV file that has all the make/models for lets say: TVs
View 1 Replies
View Related
Sep 24, 2007
Greetings,
I need some help determining the best way to accomplish my task. The workflow starts by generating a list of unique ID's from a local table. Then take that list of unique ID's and query an Oracle table for all matching records.
My thought was to first use an Execute SQL task with the following SQL:
select projectid from projectlist group by projectid
with Result Set configured as follows:
Result Name = projectid
Variable Name = varProjectIDList
Then in the Data Flow Task add a DataReader Source to pull the matching data. Here's where I'm getting hung up. I'd like to pass the result set from the Execute SQL task. I tried the following SQL but it doesn't work.
select * from masterlist where projectid = @[User::varProjectIDList]
I'm open to any suggestion on the best way to take my unique list and use it as input for a query against my Oracle DB.
Thank you for your ideas.
Rob
View 4 Replies
View Related
Nov 5, 2014
I have 1 table that is just a list of feeds. A, B, C, D etc (15 rows in total) and each feed has other information attached to it such as Full name, location etc etc. I am only interested in the Feed column.
Each feed then has a corresponding data table which contains a list of records. Eg Feed A data is contained in TableA, Feed B data is contains in TableB and so on.
Basically what I need is a combined table that shows the list of Feeds in the 1st Column ( So A, B, C, D…..) and then a second column which counts the records from each separate data table corresponding to that feed.
So the end result would look something like this:
Feed------No of Records
A----------4 (from TableA)
B----------7 (from TableB)
C----------8 (from TableC)
D----------1 (from TableD)
Possible?
View 2 Replies
View Related
Sep 30, 2015
I am trying to use FOR XML under SQL Server 2014 to write out a large XML data set. I want it to look like
<CVS_Member_Add_Change>
  <RecordType>3</RecordType>
  <Carrier>1266</Carrier>
  <MultiBirthCode>0000000</MultiBirthCode>
  <MemberType></MemberType>
[Code] ....
That's how it looks when you click on the results of a small subset of the query. Â Just what I want. Â Unfortunately when you try to right click and save it you getÂ
<dataroot><CVS_Member_Add_Change><RecordType>3</RecordType><Carrier>1266</Carrier<MultiBirthCode>0000000</MultiBirthCode><MemberType></MemberType<LanguageCode>1</LanguageCode><DURFlag></DURFlag><DURKey></DURKey><SocialSecurityNumber>000000000</SocialSecurityNumber</CVS_Member_Add_Change>
Everything being on one line blows up the translator application that reads the data.
The FOR XML statement copied out of the query is below.
FOR XML RAW ('CVS_Member_Add_Change'), ROOT('dataroot'), ELEMENTSÂ
GO
Is there a way in the T-SQL to force it to break lines neatly?
Is there a way to force it to a specific file name or directory?
View 3 Replies
View Related
May 29, 2007
Dear all
I have tow server on the same intranet. One server has a sql server 2000 database and the other one has SQL server 2005 databse.
The sql 2000 database has a table called employee. When ever a new employee is inserted in the database i would like the same values to be sent to the sql 2005 database. But this cant be done on the application level. It has to be done in the database. The application level can not be changed.
I was thinking a trigger but how to achieve the writing from one database to another. If they were on the same server then it would be easier but because they are on different servers i dont know how to do it.
Has anyone had similar issue before?
Any help is apreciated.
Sincerely
Dan
View 2 Replies
View Related
Mar 22, 2002
Has anyone been able to solve the issue with setting up a package in EM, which connects to an Exchange(.edb) database and extracts the data into a SQL Server db. Previous message posts don't offer much insight. So far, all I have is using Access 2000, to connect & move the data, then extract from here.
Thanks in advance for any help.
BV
View 1 Replies
View Related
Aug 14, 2006
I have searched everywhere for an answer and seems I am either blind or there is no simple solution. Basically I have a need to report on data stored in an Exchange 2003 data store. There is mention of a OLE DB for Exchange 2000 but nothing for Exchange 2003. For example, A company report on time spent on various categories in a staff's calendar, etc. I would like to use SQl 2005 SSIS to extract and reporting services to report. Why is this so difficult? I come from a Lotus Notes / Domino background and there are numerous articles and ways to do this? Please can some MS guru please give me some direction on where to look?
Cheers
Damien
View 3 Replies
View Related
Oct 21, 2014
I want to select weekly data from daily data.lets say Today's date-10/23/2014(Thursday) My data is in date time but i want to see only date
output should be from last week Thursday to this week Wednesday. similar for previous dates
Weekly sum(profit)
10/16 - 10/21 - $1000
10/9 - 10/15 - $4100
10/2 - 10/8 - $ 8038
--
--
--
View 2 Replies
View Related
Jul 7, 2015
We have a daily process, which copies millions of rows of data from one DB to another over Linked Server. Just checking on the best practise, are there more efficient ways than the Linked server to copy millions of rows of data from one DB to another? I checked bulk insert but that transfers the data from the file to DB not DB to DB.Â
View 6 Replies
View Related
Mar 1, 2002
Hi all,
I'd like to link a SQL Server database / table to Microsoft Exchange Server E-Mail-Address data, for an Employee Directory project.
I've read a little about "Web Store", a little about ExOLEDB, but I've come across nothing along practical lines. I.e., I still don't know where to begin!
For example the "Web Store" should be created on the SQL server, but how do you create it? Any insights will be greatly appreciated.
Gallagher
View 1 Replies
View Related
Jan 7, 2004
Hello,
I have created a MS Exchange 2000 link server in my MS SQL Server 2k. I have created a stored procedure (and a view...) using info from that linked server. When I am logged on the server as the Administrator, I can call my stored proc without any problems. When I use another computer (and I am not logged as the admin of the server) and I call the stored procedure, the following error is always raised :
Server: Msg 7302, Level 16, State 1, Procedure test_proc, Line 3
" Impossible de créer une instance du fournisseur OLE DB 'exoledb.DataSource.1'. "
<== I know it is a french error but it can be translated as : "Unable to instancied the OLE DB 'exoledb.DataSource.1' provider"
I would like to know if I can make run my stored proc in the admin account or what should I do to make it work
View 1 Replies
View Related
Jul 8, 2013
I have a series of daily data and I am looking to filter for month end business days and create a sum.
This piece of code gets what I need, arbitrarily, for the 7th day of every month. How can I amend the code so that rather than 7, I have the last business day of every month?
select FROM_DATE, PORTFOLIO, SUM(VALUES) from MyTable
where DATEPART(day,FROM_DATE) = 7
group by FROM_DATE, PORTFOLIO
I have the following code for last business day of month (from a previous question raised on these forums), but when I set DATEPART(day,FROM_DATE) equal to the following piece of code, I get no results.
CASE DATEDIFF(dd,0,DATEADD(mm,DATEDIFF(mm, 0, FROM_DATE),-1))%7
WHEN 5 THEN DATEADD(dd, -1, DATEADD(mm,DATEDIFF(mm, 0, FROM_DATE),-1)) -- if Saturday subtract one day
WHEN 6 THEN DATEADD(dd, -2, DATEADD(mm,DATEDIFF(mm, 0, FROM_DATE),-1)) -- if Sunday subtract two days
ELSE DATEADD(mm,DATEDIFF(mm, 0, FROM_DATE),-1)
END
View 15 Replies
View Related
Feb 21, 2007
We need to upgrade our HR system from SQL 2000 to SQL 2005. Support for SQL 2000 ends 12/31/2007.
We have a third party vender that do not currently support SQL 2005. Employee's data is transfered from our HR database to the third party database for the purpose of yearly performance evaluation on a daily basis.
Both databases are currenlty on a SQL 2000 server.
Can data be transferred from a SQL 2005 database to a SQL 2000 database?
View 4 Replies
View Related
Sep 24, 2014
I need to create a job that import an access database.
Does exist a command that I can use to do that?
View 6 Replies
View Related
Nov 18, 2014
I've already created a table and i wanna to insert values in that more than five hundred row ,that values are stored in Excel files, Here I've the doubt is it possible to insert values from excel sheet? I've current data base of ms sql 2000, if it is possible means, how to insert values using query?
ex:
create table test
(
item_code int,
item_name varchar(50),
bill_qty float,
bil_date datetime
)
In that excel file also had the same column name name.
View 4 Replies
View Related
Aug 4, 2015
I have a table which has been import from a TXT file. Most lines can be ignored, but when I get a line like this
'qwwwwwww 399 0 75124M - 2015-02-06 13:07:29'
I need to insert into a table as 6 columns ('-' is a value)
View 7 Replies
View Related
Aug 24, 1999
I want to check a table to see what rows have been updated today, then write to a text file some data from the selected rows; then I want to automate this (DTS package? TSQL stored procedure job?) to run every night at midnight. Is the DTS Wizard the best way, that's what I did, but have not confirmed that it is writing a new text file every day, and does each new version write over the old one?
View 1 Replies
View Related
Dec 11, 2012
I have a table thats updated daily with monthly data totals:
Month, Total orders1, Total orders2, etc
12/01/2012, 5, 8, etc
11/01/2012, 6, 5, etc
How do I pull data from this table in SQL Server for ONLY the current month? I was thinking using the getdate() function to get the current month, but it doesn't match exactly so I get no results
View 7 Replies
View Related
Dec 11, 2007
Hi,
I have a Users table in Oracle database and same table (Users) in SQL Server 2000 database. I want to create a DTS Package through which I can copy the data from Oracle database to SQL Server 2000 database. This package should run automatically at mid-night daily so that if there are some entries done in Oracle database then it get copied in SQL Server 2000 database. Also is there any way to copy only those entries from Oracle database which are not present in SQL Server 2000 database. Please help me in this regard as I am new to DTS.
Thanks
Rohit
View 1 Replies
View Related
Oct 7, 2015
how to load the data from oracle to sql server
oracle source is having 7 tables
sql server target is having 7 tables
i have used VISUAL STUDIO and created the one data for individual but how to run in sql server that ssis package
View 9 Replies
View Related
Jul 29, 2015
I have multiple web databases for storefront orders as linked servers on SQL Server 2008 R2. I need to organize the data for these orders into a structure that can be imported into my ERP application db frequently either on demand or periodically during the day. We are essentially trying to make the manual order entry process automated. My thought was to get the data into views that resemble the schema of the order table in my application db and then schedule a stored procedure with sql jobs or a load routine from within the ERP application that would insert data from the view into the order table.
View 2 Replies
View Related