all groups > sql server programming > april 2007 >
You're in the

sql server programming

group:

Notification when a new column is added to a table


Notification when a new column is added to a table deepak
4/10/2007 10:02:54 PM
sql server programming:
Hi There,

Is there a way in which Sqlserver can notify the dotnet application
when a new column is added . i believe we can not use Query
notifiaction here(correct me if i am wrong) .i am using sqlserver 2005
and dotnet 2.0 .

if anybody have an idea of how to do this or know any link in this
regard,please share with me.

Hope i am clear

Cheers
Deepak
Re: Notification when a new column is added to a table Remus Rusanu [MSFT]
4/10/2007 10:17:04 PM
Query Notifications is for detecting when the content of a table was changed
(rows inserted/delete/updated). To detect when the structure was changed
(like adding a column) you can use Event Notifications for the ALTER TABLE
event, see http://msdn2.microsoft.com/en-us/library/ms189453.aspx

HTH,
~ Remus

[quoted text, click to view]

Re: Notification when a new column is added to a table deepak
4/10/2007 11:47:09 PM
Hi Remus,

Thanks for the reply, i thought about Event Notifications .but my
question is how do you communicate the notified event from the
sqlserver to the dotnet application,is there a way to do this? .
it will be very usefull ,if you could throw some light on the same,

Cheers
Deepak



On Apr 11, 10:17 am, "Remus Rusanu [MSFT]"
[quoted text, click to view]

Re: Notification when a new column is added to a table Tony Rogerson
4/11/2007 12:00:00 AM
Hi Deepak,

Check my blog post on setting up event notifications which is what you
want ->

http://sqlblogcasts.com/blogs/tonyrogerson/archive/2007/04/06/event-notifications-monitoring-blocked-processes-and-other-events-end-to-end-how-to-set-it-up-and-make-it-work.aspx

Instead (or as well :)) as the BLOCKED_PROCESS_REPORT capture the
ALTER_TABLE event.

Tony.

--
Tony Rogerson, SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson
[Ramblings from the field from a SQL consultant]
http://sqlserverfaq.com
[UK SQL User Community]


[quoted text, click to view]
Re: Notification when a new column is added to a table Tony Rogerson
4/11/2007 12:00:00 AM
Hi Deepak,

Check my other post to your thread, I use event notifications to capture the
ALTER_TABLE event, you would store that in a normal database table.

You could then use query notifications to capture that new row being
inserted, i'll try and get an example working this weekend if I've time.

Tony.

--
Tony Rogerson, SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson
[Ramblings from the field from a SQL consultant]
http://sqlserverfaq.com
[UK SQL User Community]


[quoted text, click to view]
Re: Notification when a new column is added to a table deepak
4/11/2007 7:29:29 AM
HI Tony,

Thanks for your replies, i went through your blog, it was very
informative.i will try in the same lines has you have suggested(using
both Event Notification and Query Notification ).

Thank you very much
Deepak




[quoted text, click to view]

Re: Notification when a new column is added to a table Remus Rusanu [MSFT]
4/11/2007 10:14:12 AM
See
http://blogs.msdn.com/remusrusanu/archive/2007/04/11/consuming-event-notifications-from-clr.aspx

[quoted text, click to view]

AddThis Social Bookmark Button