Showing posts with label idea. Show all posts
Showing posts with label idea. Show all posts

Monday, March 26, 2012

Polling in 2005

Hi folks,

Somebody got an idea about how to implement the following in SQL 2005? Or does anybody know of an example posted somewhere for this? In my opinion it's such a common problem, someone somewhere is bound to have written something about this somewhere (but I could nog find it).

We've got a table in a database and regularly an event happens that inserts a record in this table. At that moment a signal should be given to a .NET-service (in the form of a XML-message) which will do some intelligent stuff with this info.

In SQL 2000 I would implement a polling mechanism that every 10 secs (or some other appropriate interval) would do a select on the table to see if anything had changed. But with all the new features in 2005, I'm of the opinion that this could be done differently.

I've been looking at:

Notification Services, but this looks a bit like overkill for such a simple demand.
Query notifications from the Service Broker. But this is also a bit much because deletes are also a cause for a notification. Also all the articles I found are dealing with cache expiration. (Afterthought... maybe SELECT MAX(id) will work as defined query)

Ofcourse it would be nice if the signal is queued somewhere when the receiving service is temporarily not available.

Thanx in advance,

Lexwant to give us a why and what you are trying to do?

I might have a trigger fire into a log table and then take action on that...but I don't see a need|||To put a simple, a bunch of different processes can insert records in a table indicating a document is ready to be processed. Each time a new record is added a signal has to be sent to a .NET-service (in XML-form). This signal will process the document further.

Happy holidays...

Friday, March 9, 2012

please, how to realize generalization in sql server database

please help, I need professional approach how to realize generalization
(parent_table <- child_table) idea in sql server databse?

in my Oracle db I can have PK of child_table as FK from parent_table: let's
have shop with shoes, selling shoes, and foosd as well. Example of keys in
my tables:

Product (=parent_table)
----
1
2
3
4
5

Food (=child_table)
----
2
3
4

Shoes (=child_table)
----
1
5

Is that good idea, or not, and may I have the same in SQLServer (2005) ?
(and, what about administrative aspects (like
performance/concurency/updating ..) of generalization in RDMS?)

regardsfireball wrote:

Quote:

Originally Posted by

please help, I need professional approach how to realize generalization
(parent_table <- child_table) idea in sql server databse?
>
in my Oracle db I can have PK of child_table as FK from parent_table: let's
have shop with shoes, selling shoes, and foosd as well. Example of keys in
my tables:
>
Product (=parent_table)
----
1
2
3
4
5
>
Food (=child_table)
----
2
3
4
>
Shoes (=child_table)
----
1
5
>
Is that good idea, or not, and may I have the same in SQLServer (2005) ?
(and, what about administrative aspects (like
performance/concurency/updating ..) of generalization in RDMS?)
>
>
>
>
regards


The syntax is the same in SQL Server and Oracle (and other SQL DBMSs as
well):

CREATE TABLE Product (sku INT NOT NULL PRIMARY KEY);

CREATE TABLE Food (sku INT NOT NULL PRIMARY KEY REFERENCES Product
(sku));

CREATE TABLE Shoes (sku INT NOT NULL PRIMARY KEY REFERENCES Product
(sku));

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/...US,SQL.90).aspx
--