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.
Author |
Topic |
haven104
Starting Member
1 Post |
Posted - 2009-09-16 : 21:55:59
|
Hey Guys,This is essentially my first attempt at anything to do with SQL server, so I thought I'd jump straight into the deep end with a real world problem! Forgive my grammar, spelling and generally poor knowledge on the subject matter!New Zealand is about to release a new series of national topographic maps. The maps are in a different projection from the old maps (so the coordinates are different.) The government body responsible for looking after the maps has published some C++ code to convert coordinates between the projections. I'd like to implement this code in SQL Server Express 2008 as a stored procedure. Before I get too deep into this - is this possible? Is C++ the right language and/or do I need to translate the code? This is where it gets hazy for me!I've worked through the basic CLR examples in Books Online, and believe the process to follow is:Compile the code to a dll > create a database assembly from the dll > create a procedure to access the method > run the procedure.I'll leave my questions there for now - I don't want to write a novel here! If someone is interested in working through this with me - I'd be very appreciative.The end goal of this is to have a procedure that will run each time a new record is added, to fill two empty columns with a translated pair of original coordinates.Thanks for any help, comments, wisdom.Regards,Tommo |
|
YellowBug
Aged Yak Warrior
616 Posts |
Posted - 2009-09-17 : 04:59:50
|
Yes, that looks about right. I'd suggest you also:1. CREATE ASSEMBLY ... WITH PERMISSION_SET = SAFE2. Try to create a FUNCTION (instead of a procedure), so you can use this in an INSERT trigger/ computed column. There are some restrictions (e.g. deterministic), but see if it is possible.Good luck! |
|
|
|
|
|