I have a directory with files:
X.dbf
X.mdx
Y.dbf
Y.mdx
...
These files contain updates for my DB (I don't know their structure). How I can insert them in temporary tables on the SQL server ?
Note: I don't want to use Import/Export Tool, cause I will need this insert as scripts...I'd use DTS.
-PatP|||I'd use DTS.
-PatP
You would?
I'd create a sproc...
USing xp-Cmdshell, I would interogate the directory and load the file names to a table.
I would process the files 1 by 1
I would the bcp the data in to a single column varchar table
I would then process the data.
Bu if you don't know the structure of the data, what would you propose you'd do?|||Last time I did something like this, the .dbf extension files came from dBase V. DTS has an interface for that datafile type. As for .mdx ... ?|||It isn't hard to determine the schema of a DBF file, as Tom pointed out they are just dBase files which are effectively a single table with the schema tucked into the file header. You can relatively easily import arbitrary dbf files into a database from within a DTS package... It is more complex than dealing with a static structure, but not rocket science by any means.
The MDX files are just queries written as Multi-dimensional Expressions. Those can simply be stuffed into a TEXT column somewhere, probably the best organization would be to simply track what file they came from (X.MDX) and the text in a single table, maybe with some decorative columns to track when the file was timestamped, when it was imported into the table, etc.
-PatP|||Multi-dimensional Expressions? I may be way off, but I think I remember MDX to be primary indexes and NDX secondary (?)...Or maybe it's FoxPro? It's been awhile.|||I should just make it part of my sig...
"It really helps if you read these things"|||...and your point is...?
Showing posts with label mdx. Show all posts
Showing posts with label mdx. Show all posts
Monday, March 19, 2012
Friday, February 10, 2012
build error, MDX reports
I get this error for some of my reports, it only happens for my MDX reports
and even then it is not all of them. They have all worked at some point or
another but recently this has started to happen
The expression for the query 'DataSet1' contains an error: [BC306481] String
constants must end with a double quote.
here's the code from dataSet1 of one of my reports
= "WITH" & " MEMBER [Measures].[Percentage Pref]" & "
AS"&" 'iif(isempty([Measures].[Number]),CDBl(0),"&" iif( sum(
{Ancestor([Preference Status].CurrentMember,1) } , [Measures].[Number]) = 0, 0,"&" cdbl(cdbl( [Measures].[Number]) / sum( {Ancestor([Preference
Status].CurrentMember,1) }, [Measures].[Number]) )))' " &
"select " &
"{[Measures].[Number],[Measures].[Percentage Pref]} on columns, " &
"{[Preference Status].[Preference Status].Members} on rows, " &
"{[Preference School].[Preference School LEA].[" & Parameters!LEA.Value &
"]} on pages, " &
"{[Round].[Round].[" & Parameters!Round.Value & "]} on AXIS(3) " &
"from [admissions]"
has the right number of quotes and i know this because they have worked
before, which leads me to believe there is an underlying error somewhere
else.
Any ideas' MSFT guys, this sounds like your area'
thanks
GregFixed this myself, for some unknonw reason you need to put quoates at the
beginning and end of every single line..... any of the MSFT guys wanna
explain why?
This was a very strange error as it has worked before without quotes on
every line.
Greg
"Greg" <Greg.conn@.nospam.nospam> wrote in message
news:epwa4TB$FHA.1548@.TK2MSFTNGP10.phx.gbl...
>I get this error for some of my reports, it only happens for my MDX reports
>and even then it is not all of them. They have all worked at some point or
>another but recently this has started to happen
> The expression for the query 'DataSet1' contains an error: [BC306481]
> String constants must end with a double quote.
> here's the code from dataSet1 of one of my reports
> = "WITH" & " MEMBER [Measures].[Percentage Pref]" & "
> AS"&" 'iif(isempty([Measures].[Number]),CDBl(0),"&" iif( sum(
> {Ancestor([Preference Status].CurrentMember,1) } , [Measures].[Number])
> = 0, 0,"&" cdbl(cdbl( [Measures].[Number]) / sum( {Ancestor([Preference
> Status].CurrentMember,1) }, [Measures].[Number]) )))' " &
> "select " &
> "{[Measures].[Number],[Measures].[Percentage Pref]} on columns, " &
> "{[Preference Status].[Preference Status].Members} on rows, " &
> "{[Preference School].[Preference School LEA].[" & Parameters!LEA.Value &
> "]} on pages, " &
> "{[Round].[Round].[" & Parameters!Round.Value & "]} on AXIS(3) " &
> "from [admissions]"
> has the right number of quotes and i know this because they have worked
> before, which leads me to believe there is an underlying error somewhere
> else.
> Any ideas' MSFT guys, this sounds like your area'
> thanks
> Greg
>
>
and even then it is not all of them. They have all worked at some point or
another but recently this has started to happen
The expression for the query 'DataSet1' contains an error: [BC306481] String
constants must end with a double quote.
here's the code from dataSet1 of one of my reports
= "WITH" & " MEMBER [Measures].[Percentage Pref]" & "
AS"&" 'iif(isempty([Measures].[Number]),CDBl(0),"&" iif( sum(
{Ancestor([Preference Status].CurrentMember,1) } , [Measures].[Number]) = 0, 0,"&" cdbl(cdbl( [Measures].[Number]) / sum( {Ancestor([Preference
Status].CurrentMember,1) }, [Measures].[Number]) )))' " &
"select " &
"{[Measures].[Number],[Measures].[Percentage Pref]} on columns, " &
"{[Preference Status].[Preference Status].Members} on rows, " &
"{[Preference School].[Preference School LEA].[" & Parameters!LEA.Value &
"]} on pages, " &
"{[Round].[Round].[" & Parameters!Round.Value & "]} on AXIS(3) " &
"from [admissions]"
has the right number of quotes and i know this because they have worked
before, which leads me to believe there is an underlying error somewhere
else.
Any ideas' MSFT guys, this sounds like your area'
thanks
GregFixed this myself, for some unknonw reason you need to put quoates at the
beginning and end of every single line..... any of the MSFT guys wanna
explain why?
This was a very strange error as it has worked before without quotes on
every line.
Greg
"Greg" <Greg.conn@.nospam.nospam> wrote in message
news:epwa4TB$FHA.1548@.TK2MSFTNGP10.phx.gbl...
>I get this error for some of my reports, it only happens for my MDX reports
>and even then it is not all of them. They have all worked at some point or
>another but recently this has started to happen
> The expression for the query 'DataSet1' contains an error: [BC306481]
> String constants must end with a double quote.
> here's the code from dataSet1 of one of my reports
> = "WITH" & " MEMBER [Measures].[Percentage Pref]" & "
> AS"&" 'iif(isempty([Measures].[Number]),CDBl(0),"&" iif( sum(
> {Ancestor([Preference Status].CurrentMember,1) } , [Measures].[Number])
> = 0, 0,"&" cdbl(cdbl( [Measures].[Number]) / sum( {Ancestor([Preference
> Status].CurrentMember,1) }, [Measures].[Number]) )))' " &
> "select " &
> "{[Measures].[Number],[Measures].[Percentage Pref]} on columns, " &
> "{[Preference Status].[Preference Status].Members} on rows, " &
> "{[Preference School].[Preference School LEA].[" & Parameters!LEA.Value &
> "]} on pages, " &
> "{[Round].[Round].[" & Parameters!Round.Value & "]} on AXIS(3) " &
> "from [admissions]"
> has the right number of quotes and i know this because they have worked
> before, which leads me to believe there is an underlying error somewhere
> else.
> Any ideas' MSFT guys, this sounds like your area'
> thanks
> Greg
>
>
Subscribe to:
Posts (Atom)