Showing posts with label sample. Show all posts
Showing posts with label sample. Show all posts

Sunday, February 19, 2012

about processXMLdata sample,how to insert a return in end of each row data of the result text fi

I am newbie, having a job to handle some XML files into sql server 2005. In the procXMLdata sample,,pls tell me how to insert a return in end of each row data of the result text file?

I am not familiar with this sample, but my guess is that you need to use Ragged Right Flat File format and choose {CR}{LF} as the row delimiter.

Give us more of the problem's context, if this is not what you are looking for.

Thanks.

|||

hi,

Thanks for your reply.

The processXMLdata sample was put in the sample directory of ms sql server,which just converted a xml file into a txt file ,using two xml task. The first was to preform XPATH method,output a variable, and the second xml task was to do XSLT method ,input the variable above, output a txt.

I know XML little , i guess the problem may be on propery of the second XML task.

Thursday, February 16, 2012

About new SQL Server 2005 Samples and Sample Databases

There are five msi files listed for downloading.

SqlServerSamples.msi

AdventureWorksDB.msi

AdventureWorksDBCI.msi

AdventureWorksBI.msi

AdventureWorksBICI.msi

What are the AdventureWorksDBCI.ms and AdventureWorksBICI.msi used for? I try to run it, but it return the message "Another version of this product is already installed" and ask me remove the old version of this product. Anybody know what I should remove?

Thanks,

Hi,

Seems that they either need to update their docuementation or change the file names, because the BI (Business Intelligence) was former written wir DW (Datawarehouse). THE CI means (like mentioned in the download page) Case sensitive means, that for example 'A' is not the same as 'a'. more samples about that can be found here:

http://www.databasejournal.com/features/mssql/article.php/3302341

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||

Hi Jen,

Thanks. I are right, the CI means case insensitive.

AdventureWorksDB.msi creates a AdventureWork database with collation Latin1_General_CS_AS in your SQL Server.

AdventureWorksDBCI.msi creates a AdventureWork database with collation Latin1_General_CI_AS in your SQL Server.

Depends on the server collation setting (check the properties of server and see server collation item), you can decide which two msi files should to be downloaded and run on your machine.

Thanks,

About Members and Ordinal function

When I use MDX sample application,
I write a code like this:

SELECT

{[Time].[All Time].[2005]} ON COLUMNS,

{Filter([Equipment].Members, (InStr(1, [Equipment].CurrentMember.Name, "xxxx") =1))} ON ROWS

FROM francis.

Here Equipment is a huge dimension table,actually I want to do it like

Filter([Equipment].[All types].[mechanism].Members to narrow the range as prevent duplicate.
But it failed.

One more is I can't use ordinal function in it too, but I can do it in AS and test in pivottables.

Can someone tell me the reasons?
This is probably the same issue as I mentioned on the other thread - you probably need to use the .Children function instead of the .Members function. The .Children function returns all the members 'underneath' a member in a hierarchy, the .Members function returns all the members on a dimension or level. So:
[Equipment].[All types].[mechanism].Children
should work for you.

I'm not sure what you mean about your problem with the Ordinal function - can you provide more details?

Chris|||Hi, Chris, give you more details as example. I assume[Equipment].[All types].[mechanism].[machine001] have [abc],[bcd],[efg],[hij] these children like [Equipment].[All types].[mechanism].[machine001].[abc], and in them they all have a children call [ABSmain_xxxx] like [Equipment].[All types].[mechanism].[machine001].[abc].ABSmain_abc.
Now I want to average all the ABSmain_xxx value, so I will do a filter to the set I reach now.
If I use [Equipment].[All types].[mechanism].[machine001].Children, it will only filter the [abc],[bcd]...etc, it won't go deep to their children.
I suppose to do it like [Equipment].[All types].[mechanism].[machine001].[abc].level.members,I think it will work.

|||No, your last example won't do what you want, I think - it will return all the members on the same level as[Equipment].[All types].[mechanism].[machine001].[abc]. Does[Equipment].[All types].[mechanism].[machine001].[abc].CHILDREN do what you want? Otherwise, you might want to check out the DESCENDANTS function.

You might want to read some of the articles in the 'MDX Essentials' series here:
http://www.databasejournal.com/article.php/1459531/
Especially the ones on 'family' functions such as this one:
http://www.databasejournal.com/features/mssql/article.php/2168911

HTH,

Chris|||Hi, Chris, I have checked the descendants function and it is the one I want, it works fine expect for a little longer query time than I thought.

About Members and Ordinal function

When I use MDX sample application,
I write a code like this:

SELECT

{[Time].[All Time].[2005]} ON COLUMNS,

{Filter([Equipment].Members, (InStr(1, [Equipment].CurrentMember.Name, "xxxx") =1))} ON ROWS

FROM francis.

Here Equipment is a huge dimension table,actually I want to do it like

Filter([Equipment].[All types].[mechanism].Members to narrow the range as prevent duplicate.
But it failed.

One more is I can't use ordinal function in it too, but I can do it in AS and test in pivottables.

Can someone tell me the reasons?
This is probably the same issue as I mentioned on the other thread - you probably need to use the .Children function instead of the .Members function. The .Children function returns all the members 'underneath' a member in a hierarchy, the .Members function returns all the members on a dimension or level. So:
[Equipment].[All types].[mechanism].Children
should work for you.

I'm not sure what you mean about your problem with the Ordinal function - can you provide more details?

Chris|||Hi, Chris, give you more details as example. I assume [Equipment].[All types].[mechanism].[machine001] have [abc],[bcd],[efg],[hij] these children like [Equipment].[All types].[mechanism].[machine001].[abc], and in them they all have a children call [ABSmain_xxxx] like [Equipment].[All types].[mechanism].[machine001].[abc].ABSmain_abc.
Now I want to average all the ABSmain_xxx value, so I will do a filter to the set I reach now.
If I use [Equipment].[All types].[mechanism].[machine001].Children, it will only filter the [abc],[bcd]...etc, it won't go deep to their children.
I suppose to do it like [Equipment].[All types].[mechanism].[machine001].[abc].level.members,I think it will work.

|||No, your last example won't do what you want, I think - it will return all the members on the same level as [Equipment].[All types].[mechanism].[machine001].[abc]. Does [Equipment].[All types].[mechanism].[machine001].[abc].CHILDREN do what you want? Otherwise, you might want to check out the DESCENDANTS function.

You might want to read some of the articles in the 'MDX Essentials' series here:
http://www.databasejournal.com/article.php/1459531/
Especially the ones on 'family' functions such as this one:
http://www.databasejournal.com/features/mssql/article.php/2168911

HTH,

Chris|||Hi, Chris, I have checked the descendants function and it is the one I want, it works fine expect for a little longer query time than I thought.

Thursday, February 9, 2012

About building international applications in dotnet

Hi,

I am developing an application using C#.NET that accesses a remote database that that contains japanese characters.

My sample querry is strCommand = "SELECT * FROM table WHERE prodname = 'CR新海物語スペシャルM8'";

The result of querry displayed in the binded datagrid also contains other rows that has this prodname:

CRF湯けむり紀行SF-T
CRぱちんこハイサイVR1
CRホワイトエンジェルFS

etc.

Thanks in advance for your help.

You forgot to ask a question.
|||

Hi,

I am developing an application using C#.NET that accesses a remote database that that contains japanese characters.

My sample querry is strCommand = "SELECT * FROM table WHERE prodname = 'CR新海物語スペシャルM8'";

The result of the querry above that is displayed in the binded datagrid also contains other rows that has this prodname:

CRF湯けむり紀行SF-T
CRぱちんこハイサイVR1
CRホワイトエンジェルFS

etc.

Why does the command yields other records where the prodname field contains the 'CR' thing?

Sample querry result in a datagrid:

field1 field2 field3 prodname

a as er CR新海物語スペシャルM8

w aa ww CRF湯けむり紀行SF-T

ss dd ee CRぱちんこハイサイVR1

sdds ddd ee CR新海物語スペシャルM8

rf d5r wwe CRぱちんこハイサイVR1


Does this strange and redundant output has something to do with the Japanese characters contained in some fields

of the table?

Thanks in advance for your help.


|||Try with the correct nvarchar syntax:

SELECT * FROM table WHERE prodname = N'CR新海物語スペシャルM8'