Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Running an exe conversion from trigger

Author  Topic 

htn123
Starting Member

1 Post

Posted - 2009-10-07 : 09:53:11
My project called for converting between lat/long cordinate to MGRS cordinate and store it in the SQL server.
So the user can enter either lat/long value . I will store that value in to the table and then convert it to the MGRS cordinate and then update that table and store MGRS value in that table; on the same record as the lat/long; in a difference field ofcourse. And it can go the other way MGRS-> lat/long also.

I have seen on this forum that you can call an executable from a trigger.
My questions are:
1. Can I call this executable, do the conversion and then return some values to the trigger so that the trigger can then update the record with the new converted values?
2. Is this a sensible solution or is there another easier way of doing the conversion and then update the record without having to call an outside executable?
Thanks.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-10-07 : 15:56:45
1. You can call executables, but you can not receive output from it or input anything into it.
2. I'd put the conversion code in a .NET CLR object and call that when performing the insert or update. I would not use a trigger at all.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -