Showing posts with label store. Show all posts
Showing posts with label store. Show all posts

Monday, March 26, 2012

Ragged Hierarchy / Unbalanced Hierarchy - whats the difference and how do i process it ?

Q1) what is the difference between a ragged hierarchy and an unbalanced hierarchy ?

Q2)

I have a structure for items in the store

Each item can be classified into

Category

SubCategory

Class

Most items go down all three levels

but some are only classified into the top two categories

and a few are only classified in the Category classification

i have tried to create a Hierarchy for this

but when i review the results in the browser, it will only show me the results of the items that are classified to the bottom level - it does NOT show me the ones that are classified in only the top one or two levels

according to BOL

"To make a parent-child hierarchy ragged, use the SkippedLevelsColumn property of the parent attribute in the hierarchy to support the ragged structure."

but i have found that this has been removed from AS2005

(http://msdn2.microsoft.com/en-us/library/ms143229.aspx)

Skipped levels in parent-child hierarchies

The SkippedLevelsColumnproperty, which indicates how many levels to skip when creating a member under a parent in a parent-child hierarchy, is no longer supported.

so - how can this be done ?

Hello! To me a ragged or unbalanced hierarchy is the same.

You control this on each level in the user hierarchy in the dimension editor. Click on a level in the hiearchy and check the property "HideMemberIf"

Parent-Child dimensions is a different case because they have unnamed, recursive levels. Ragged and Unbalanced Hierarchies have named levels but with missing members or values in each level in the user hierarchy.

HTH

Thomas Ivarsson

|||

Thomas

thx for this

but can you please explain a bit more

i have set the HideMemberIf property on both the SubCategory and Class description to NoName - and this hides the blank entries (as expected)

But

when i put attribute relationships between the SubCategory and Category and between the SubCategory and Class onto the hierarchy (in the Hierarchies and Levels panel), then the original problem arises in that the entries are not shown in the cube browser

m

|||

Hello again. I have checked the Geography dimension and the Geography-hierarchy in the Adventure Works sample cube that is part of the installation of SQL Server 2005.

In this hierarchy you have the levels Country-StateProvince-City-PostalCode all with attribute relations to the parent and a HideMemberIf-property set to NoName on the StateProvince level. United Kingdom have no members in the StateProvince-level, like you can see in the browser. All other countries have. This example works as you expect so you must have another problem in your dimension.

The HideMemberIf-property will not be supported in the next release of SQL Server, according to books on line.

HTH

Thomas Ivarsson

Tuesday, March 20, 2012

Quotation Marks in SQL Server

I have an ASP.Net page that allows people to type in strings and store them into a SQL Server DB; which in turn gets displayed on a website.

The project has an admin side that can add/delete/edit announcements, which get displayed on an intranet site. These announcements can be clicked on to display further detail. When announcements are clicked on a javascript popup window is generated that displays the strings. All data is stored in a SQL Server DB.

What I need to know is: how do I check to see if a string has a quotation mark or apostrophe in it so that I can replace it with the appropriate HTML code? (Though it seems I can't display an apostrophe, even when using the HTML code ''')

If I store the string as was entered by the administrator (with quotation marks instead of '"'), the popup window will not display.

Try the links below for all the info you need including how to enable QUOTED_IDENTIFIER option in your create database statement and the restrictions. Hope this helps.

http://msdn2.microsoft.com/en-US/library/ms174393.aspx

http://msdn2.microsoft.com/en-US/library/ms176027.aspx

|||

Search the forums for:

A) Parameterized SQL Query (What you should do)

B) SQL String concatenation (What you are probably doing)

C) SQL Injection attack (The security problems of doing B instead of A)

|||

Motley:

Search the forums for:

A) Parameterized SQL Query (What you should do)

B) SQL String concatenation (What you are probably doing)

C) SQL Injection attack (The security problems of doing B instead of A)

Not worried about SQL Injection attacks. This is an intranet app.|||

Caddre:

Try the links below for all the info you need including how to enable QUOTED_IDENTIFIER option in your create database statement and the restrictions. Hope this helps.

http://msdn2.microsoft.com/en-US/library/ms174393.aspx

http://msdn2.microsoft.com/en-US/library/ms176027.aspx

Can you enable the Quoted_Identifier only when you create a new table?|||You can do it in your create database statement or create table, the how for table is covered in the second link. Hope this helps.|||After reading the replies and links that were posted, I feel that I need to reiterate my question.

There is a page that displays records from a SQL Server DB. These records are "announcements" on an internal bulletin board. An admin has a special page that gives the admin the ability to edit, add or delete any of these records.

For instance, an admin can add an announcement (using a textbox) that says, 'This sentence has "Quotation Marks" in it'. I want to be able to search that specific phrase for the quotation marks and replace them with the appropriate code so that they may be displayed on the bulletin board. I don't want the admin to have to type double quotes or double apostrophes in order for them to show up.

The page needs to be user friendly with any concates or alterations to occur server side.

So if anyone can tell me the proper way of say

if str.chars(x) = "<quotation>" then ...

that would be much appreciated.

This is the javascript that generates the pop-up window:
Alert Descrip

<script language="javascript">
//popup function which recieves the email group description and name as parameters
function popitup3(description, name)
{
newwindow2=window.open('','name','height=400,width=600,scrollbars=yes');
var tmp = newwindow2.document;
tmp.write('<html><head><title>Alert Description</title>');
tmp.write('</head><body><font face="verdana, tahoma, sans-serif" size="2"');
tmp.write('b><br><p align="justify">');
tmp.write(description);
tmp.write('</p><p><a href="javascript:self.close()">close</a> this window.</p>');
tmp.write('</body></html>');
tmp.close();
}
</script>
Variable description is where the text with the quotes would most likely be.|||

I am sorry I did not understand your original post you are looking for ANSI SQL LIKE and Pattern search. Try the link below for sample code. Hope this helps.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_la-lz_115x.asp

Friday, March 9, 2012

Quick Question on SP and Transactions

Hello
Say if I have a Store Procedure that creates a named
transaction.
Can I have a different SP which commits or rollbacks it ?
Thanks
Yes, if the second SP was called by the first SP from within the same
transaction. In that case, it would all be in the same calling stack and
transaction space.
However, I generally don't like the idea of having transaction bounds cross
procedures like that. I find that it inevitably leads to transaction and
logic errors since programmers will get conufsed about how the transactions
interact with each other.
"Jimbo" <anonymous@.discussions.microsoft.com> wrote in message
news:414c01c488fb$bda7dc00$a301280a@.phx.gbl...
> Hello
> Say if I have a Store Procedure that creates a named
> transaction.
> Can I have a different SP which commits or rollbacks it ?
> Thanks
>

Quick Question on SP and Transactions

Hello
Say if I have a Store Procedure that creates a named
transaction.
Can I have a different SP which commits or rollbacks it ?
ThanksYes, if the second SP was called by the first SP from within the same
transaction. In that case, it would all be in the same calling stack and
transaction space.
However, I generally don't like the idea of having transaction bounds cross
procedures like that. I find that it inevitably leads to transaction and
logic errors since programmers will get conufsed about how the transactions
interact with each other.
"Jimbo" <anonymous@.discussions.microsoft.com> wrote in message
news:414c01c488fb$bda7dc00$a301280a@.phx.gbl...
> Hello
> Say if I have a Store Procedure that creates a named
> transaction.
> Can I have a different SP which commits or rollbacks it ?
> Thanks
>

Quick Question on SP and Transactions

Hello
Say if I have a Store Procedure that creates a named
transaction.
Can I have a different SP which commits or rollbacks it ?
ThanksYes, if the second SP was called by the first SP from within the same
transaction. In that case, it would all be in the same calling stack and
transaction space.
However, I generally don't like the idea of having transaction bounds cross
procedures like that. I find that it inevitably leads to transaction and
logic errors since programmers will get conufsed about how the transactions
interact with each other.
--
"Jimbo" <anonymous@.discussions.microsoft.com> wrote in message
news:414c01c488fb$bda7dc00$a301280a@.phx.gbl...
> Hello
> Say if I have a Store Procedure that creates a named
> transaction.
> Can I have a different SP which commits or rollbacks it ?
> Thanks
>

Wednesday, March 7, 2012

Quick Question - Need some advice on troubleshooting SSIS Errors

Hi Everyone:

I have a SSIS Package which in brief moves data from one SQL data store to another. On my local machine, the package executes fines, and does what it is supposed to do, by moving data from Point A to Point B. I have both Point A(DB) and Point B(DB) on my local machine. But when I deploy this package over to ASSEMBLY which is basically another environment, I get weird intermittent errors. What should I do? Can someone give me some tips on how to do good error logging in SSIS? I am currently writing to Windows Event Log, and I seem to look at some errors that are coming thru. What else can I do on SSIS Package side, to improve error reporting and handling, so troubleshooting is faster and more effective. I just need some stable advice on how to setup my package to do error logging where troubleshooting issues in different environments is more effective. Also I need to know, what could be causing these issues? Thanks.

MA

Try turning on package logging. Set it to log to SQL Server. It will then be in the chosen databases' sysdtslog90 table.

Right click on the control flow background to get at package logging.|||

There are plenty of resources out there....

SSIS Logging

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

http://msdn2.microsoft.com/en-us/library/ms167456.aspx

http://www.microsoft.com/downloads/details.aspx?FamilyID=526e1fce-7ad5-4a54-b62c-13ffcd114a73&DisplayLang=en

Custom Logging:

http://blogs.conchango.com/jamiethomson/archive/2005/06/11/SSIS_3A00_-Custom-Logging-Using-Event-Handlers.aspx

|||

Do i have to specify this table in the configuration column when setting up the log provider to write to SQL Server tables? Where do i find sysdtslog90 table? Thanks.

|||

MA2005 wrote:

Do i have to specify this table in the configuration column when setting up the log provider to write to SQL Server tables? Where do i find sysdtslog90 table? Thanks.

When you set up logging, you have to chose a database/connection. In that database you'll find the sysdtslog90 table.|||

Here is the error I keep getting, which I am not getting in my Local Machine Environment. Hmmmm... any ideas?

Executing the query "exec dbo.uspSaveMain_CEAImport ?, ?, ? OUTPUT" failed with the following error: "Grantor does not have GRANT permission.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set

correctly, or connection not established correctly.

|||It looks like your user lacks some DB permission in the env where you are pointing to.

Monday, February 20, 2012

Questions that need answer.

Can any one help me with this questions?
1 - Does NS always create a table where it stores the data that checks?
2 - Can I store the alerts to a table? Is yes, how?
3 - How many delivery channel exist?
4 - Can multiple application have more than one subscription event rule?

Thanks

Ricardo Carvalho

Hi Ricardo -

With regards to your questions:

1) When you create an SQLNS instance, a number of underlying database objects (tables, views, sprocs, etc) are created to support the instance. You can have those objects created in a new database or in an existing database. The same goes for each application that you have associated with an instance. Check out the sample applications.

2) The way SQLNS works (the big picture) is that subscribers ask to receive notifications for specific items. Events enter the system through event providers. The generator periodically matches the events that have entered the system with the subscriptions to produce notifications. Those are stored in a table awaiting processing by the distributor. The distributor formats the notifications, providing any needed aggregation, and hands it off to the delivery channel.

3) Two delivery channels come built-in, the file channel and the smtp channel. If neither of these satisfies your requirements, you can build your own using the API.

4) Sure.

I'd encourage you to go through the walk-through sample application that comes with SQLNS and see if that clears up some things.

HTH...

Joe

4)