So, I've read some past articles that indciate there's no easy way of knowin
g
within a CLR trigger what table the trigger is acting against?!
I read there are 2 possible solutions:
1) Add a String argument to the CLR Trigger to pass the table name. Then
Create a user defined function for each table that will have this trigger
registered on.
or
2) Use the dm_tran_locks to retrieve the name of the table
Is this still the case?Hi Trex,
Welcome the MSDN newsgroup.
As for the SQL CLR managed trigger, actually it is designed for binding to
a certain target table. that's why at runtime the SQLTriggerContext class
dosn't contain any database/tablename info...
Also, is the article you mentioned the below one?
#SQL Server 2005: CLR Integration
http://blogs.msdn.com/sqlclr/archiv.../21/495438.aspx
I think the method mentioned there such as using an additional string input
parameter to supply table name may be a workaround if you do need to get
the bound table's name in the CLR trigger's code.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Yes, that's the one I had read. I guess I still don't understand why but
that's not as important to me now. So, can the trigger define a parameter?
Create Trigger EnforceInheritanceTriggerOnCar on [Foo].[Car]
For INSERT as External Name
CLRTriggers.[My.SQLServer.InheritanceTriggers].EnforceBaseObject
GO
Or do have have to convert my CLRTrigger to a CLRFunction with a parameter
then have the SQL trigger simply call it?
Thanks for your reply!!
"Steven Cheng[MSFT]" wrote:
> Hi Trex,
> Welcome the MSDN newsgroup.
> As for the SQL CLR managed trigger, actually it is designed for binding to
> a certain target table. that's why at runtime the SQLTriggerContext class
> dosn't contain any database/tablename info...
> Also, is the article you mentioned the below one?
> #SQL Server 2005: CLR Integration
> http://blogs.msdn.com/sqlclr/archiv.../21/495438.aspx
> I think the method mentioned there such as using an additional string inpu
t
> parameter to supply table name may be a workaround if you do need to get
> the bound table's name in the CLR trigger's code.
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>|||Thanks for your response.
Normal SQL native trigger also dosn't provide parameters. So I think we
still have to create a CLR function (have a parameter) and let our SQL CLR
trigger call that function and pass a fixed name when attatched to a
certain table.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Showing posts with label articles. Show all posts
Showing posts with label articles. Show all posts
Monday, March 19, 2012
Saturday, February 25, 2012
Client-side xml updates and commits
Hi, I've been digging through online docs to see if SQLXML can do what I'm
hoping, and articles say it can, but not how...
My SQL database has regular relational tables, which I'd like to query
through xpath from a C# app, get the data returned to an XmlDocument (or
XPathDocument, but not a DataSet, which I found a sample for), use XPath to
make changes to the XmlDocument, and then commit the changes back to the SQL
tables.
The bottom of this page:
http://blogs.sqlxml.org/bryantlikes/...10/29/200.aspx regarding
Whidbey features, says "XmlAdapter - like SqlDataAdapter, fills an
XPathDocument from SQL Server, updates the changes back to SQL Server using
autogenerated update statements. Very nice!" which sounds like exactly what
I'm looking for, but searching for more information on "XmlAdapter" just
brings up a bunch of FoxPro stuff. Maybe this feature has been renamed in
the almost two years since that blog post - can anyone point me to current
documentation or samples on how to go about this? I can use SQL 2005 if
needed.
Thanks,
Roger
Hi,
This feature of XML adapter which you have been looking for is not available
in SQL server 2005 beta2.
refer to this link for more info.
http://www.aspnetdev.de/ClassReferen...mlAdapter.aspx
Thanks
"Roger W." wrote:
> Hi, I've been digging through online docs to see if SQLXML can do what I'm
> hoping, and articles say it can, but not how...
> My SQL database has regular relational tables, which I'd like to query
> through xpath from a C# app, get the data returned to an XmlDocument (or
> XPathDocument, but not a DataSet, which I found a sample for), use XPath to
> make changes to the XmlDocument, and then commit the changes back to the SQL
> tables.
> The bottom of this page:
> http://blogs.sqlxml.org/bryantlikes/...10/29/200.aspx regarding
> Whidbey features, says "XmlAdapter - like SqlDataAdapter, fills an
> XPathDocument from SQL Server, updates the changes back to SQL Server using
> autogenerated update statements. Very nice!" which sounds like exactly what
> I'm looking for, but searching for more information on "XmlAdapter" just
> brings up a bunch of FoxPro stuff. Maybe this feature has been renamed in
> the almost two years since that blog post - can anyone point me to current
> documentation or samples on how to go about this? I can use SQL 2005 if
> needed.
> Thanks,
> Roger
>
>
hoping, and articles say it can, but not how...
My SQL database has regular relational tables, which I'd like to query
through xpath from a C# app, get the data returned to an XmlDocument (or
XPathDocument, but not a DataSet, which I found a sample for), use XPath to
make changes to the XmlDocument, and then commit the changes back to the SQL
tables.
The bottom of this page:
http://blogs.sqlxml.org/bryantlikes/...10/29/200.aspx regarding
Whidbey features, says "XmlAdapter - like SqlDataAdapter, fills an
XPathDocument from SQL Server, updates the changes back to SQL Server using
autogenerated update statements. Very nice!" which sounds like exactly what
I'm looking for, but searching for more information on "XmlAdapter" just
brings up a bunch of FoxPro stuff. Maybe this feature has been renamed in
the almost two years since that blog post - can anyone point me to current
documentation or samples on how to go about this? I can use SQL 2005 if
needed.
Thanks,
Roger
Hi,
This feature of XML adapter which you have been looking for is not available
in SQL server 2005 beta2.
refer to this link for more info.
http://www.aspnetdev.de/ClassReferen...mlAdapter.aspx
Thanks
"Roger W." wrote:
> Hi, I've been digging through online docs to see if SQLXML can do what I'm
> hoping, and articles say it can, but not how...
> My SQL database has regular relational tables, which I'd like to query
> through xpath from a C# app, get the data returned to an XmlDocument (or
> XPathDocument, but not a DataSet, which I found a sample for), use XPath to
> make changes to the XmlDocument, and then commit the changes back to the SQL
> tables.
> The bottom of this page:
> http://blogs.sqlxml.org/bryantlikes/...10/29/200.aspx regarding
> Whidbey features, says "XmlAdapter - like SqlDataAdapter, fills an
> XPathDocument from SQL Server, updates the changes back to SQL Server using
> autogenerated update statements. Very nice!" which sounds like exactly what
> I'm looking for, but searching for more information on "XmlAdapter" just
> brings up a bunch of FoxPro stuff. Maybe this feature has been renamed in
> the almost two years since that blog post - can anyone point me to current
> documentation or samples on how to go about this? I can use SQL 2005 if
> needed.
> Thanks,
> Roger
>
>
Subscribe to:
Posts (Atom)