using AJAX

Hi,

For a particular application in mind I intend using AJAX to directly access a SQL procedure/ web-service preferably bypassing IIS (since it may act only as a pass-thru) using XMLhttp.

Two  questions,

Does SQL2005 provide access to procedures over http (I read it somewhere) w/o IIS

Can I store some of my javascript logic in a BLOB and access it over http to rewrite part of a page

any info will help.

thanks,

R


Answer this question

using AJAX

  • Sukhia

    Hi.

    Great minds thinks alike. I actually started at this. It was bad (for me) for a few reasons.
    1) You can not use HTTP endpoints without authenticating your self to SQL Server. This actually takes quite some time. (no anonymous).
    2) It is difficult. More difficult than creating asp.
    3) You will not have support for connection pooling with this architecture.
    4) It will not scale well.
    ...More...

    I also started on hosting inside SQL with CLR. I might take it up later... It is not straight forward.

    I would suggest standard ADO.NET. With IIS 6+

    I finally ended up writing my own web server (HTTP.SYS/C) for this, but it took much, much time I could use more wisely, also, it is not stable yet...
    http://gorm-braarvig.blogspot.com/2005/10/web-database-server-oh-yeah-database.html
    ...creating excellent AJAX providers might be an art, doing it before the technology is ready is waisting life.

    Hope this helps

  • MatthewR

    In addition to Adam's comments.  I use ajax on my website to update the web page without posting back. After you add a reference to the ajax library any function marked as an ajax method is available to be called in the java script. You could pass the data to the javascript with an ajax method

    http://www.vb-tips.com/default.aspx ID=12499601-19c8-43bf-94bd-73214b27750c

    Jason Diamonds ajax library
    http://jason.diamond.name/weblog/2005/08/18/my-ajax-dot-net-release-5 

  • Geof The Canuck

    Hi ... thanks for the postings fr all of u.

    I am aware of the security issues related to this approach but ...

    a. in this case the application is running in a private network.

    b. the application runs in standalone mode with replication (manual as well as SQL replication)

    c. idea was to reduce admin tasks related to updates to software. We were thinking it would be wonderful to just do a SQL replication and provide updates to the software rather than what we do today .. viz. give an msi file that needs to update in 40+ installations. That is the reason why I was wondering if the initial page load scripts (js) could also be stored in a BLOB!!

    d. In case you are wondering why a browser-based appl for a standalone need. Two reasons actually. One is that the appl has the potential of moving to a web platform tomorrow (or in the head office). Two, great skills are available within the company in browser-based appls. Also with MS technology of creating an EXE file using embedded html (res protocol with dlls) it may look'n'feel like a Windows form appl.

    e. The AJAX angle is to give a portal look'n'feel to the application with partial updates to the pages, ofcourse.

    Correct me if I am wrong, but our experience has shown that application updates cause changes to the appl code as well as changes to the database part viz. structures, procedures, triggers, view definitions etc. Managing them in a single install case is fine but with multiple installs its a headache hence we were contemplating this approach :-)

    Any help on storing a html + js page in a blob and access it by a procedure/ aspx call

    thanks,


  • The Hedgehog

    Yes, SS2005 does support HTTP endpoints without IIS, if you're running Windows 2003 Server.  But in my opinion you're asking for trouble if you're connecting directly from a web page to your SQL Server.  To me, this seems like a challenge on two fronts:
     
    A) Security.  I'm not sure that I would want to expose a SQL Server to the net in any way, including HTTP endpoints.  I would still prefer having a web server in the mix somewhere.  But perhaps I'm overly conservative in that way.
     
    B) Scalability.  Web servers are a lot cheaper than database servers.  If you're accessing the same content over and over (as web pages tend to do), you'll see much better scale by caching the data on a web server than continually getting it directly from the database server.  As usage increases this will become an issue.  Would you rather buy a second database server, or a second web server
     

    --
    Adam Machanic
    Pro SQL Server 2005, available now
    http://www..apress.com/book/bookDisplay.html bID=457
    --
     
     
    Hi,

    For a particular application in mind I intend using AJAX to directly access a SQL procedure/ web-service preferably bypassing IIS (since it may act only as a pass-thru) using XMLhttp.

    Two  questions,

    Does SQL2005 provide access to procedures over http (I read it somewhere) w/o IIS

    Can I store some of my javascript logic in a BLOB and access it over http to rewrite part of a page

    any info will help.

    thanks,

    R

  • using AJAX