Can I spell check text fields

  • I have a memo/text field in one of my tables that was used as part of an input form.  Now I'd like to spell check the field for any spelling errors.  Is there a way do that in SQLServer?

    Jacqueline

  • Not sure about spell checking from Transact-SQL, but for use with applications and servers at the time of data entry, check out http://www.wintertree-software.com/ 

  • Not sure this is what you are looking for ... but we use "VSSPELL" (an ActiveX control) from ComponentOne in our client application that allows our users to run spell check on the data that our users enter into our text fields.


    Have a good day,

    Norene Malaney

  • Try this. You'll need Word installed on the machine you're running this on. It works but it's [slow].

    Cheers,

    Ken

    CREATE FUNCTION dbo.CheckSpelling (@checkword VARCHAR(50))

    RETURNS BIT AS

    BEGIN

    DECLARE @w INT,

    @s-2 BIT,

    @t INT

    EXEC sp_OACreate 'Word.Application', @w OUTPUT

    EXEC sp_OAMethod @w, 'Documents.Add', @t OUTPUT

    EXEC sp_OAMethod @w, 'CheckSpelling', @s-2 OUTPUT, @checkword, '', TRUE

    EXEC sp_OAMethod @w, 'Quit'

    EXEC sp_OADestroy @w

    RETURN @s-2

    END

  • OK. I'm an idiot. I forgot to put in example usage.

    select dbo.checkspelling('blah') -- Returns 1 (success)

    select dbo.checkspelling('blahh') -- Returns 0 (failure)

    Sorry 'bout that...

    Ken

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply