question

karuppiah88 avatar image
karuppiah88 asked

In Sql database and the trigger the powershell script when there is a insert of data

Hi in my sql database when there is insertion of row i need to trigger my powershell script 1) in powershell script i have written code for random password so that function should be called when there is a insertion of a data in the sql server am not sure how to trigger the powershell script in the sql server
sqlpowershell
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Grant Fritchey avatar image
Grant Fritchey answered
The only way I know of that you could do this would be to [create a CLR function][1] and then call that from your trigger. This will work because PowerShell is .NET compliant. But, this is not something I've ever done, and, you're likely to hit issues if you don't write the CLR function carefully. [1]: http://msdn.microsoft.com/en-us/library/w2kae45k(v=vs.90).aspx
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

karuppiah88 avatar image karuppiah88 commented ·
Can you explain bit clearer with some examples like having a sql table and insert a record and trigger the powershell script ot what you have suggested give me some example am not clearer
0 Likes 0 ·
Grant Fritchey avatar image Grant Fritchey ♦♦ commented ·
It's going to be tough to do, but here's an introduction from Microsoft http://technet.microsoft.com/en-us/library/ms179562.aspx
0 Likes 0 ·
karuppiah88 avatar image
karuppiah88 answered
Can you explain bit clearer with some examples like having a sql table and insert a record and trigger the powershell script ot what you have suggested give me some example am not clearer
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.