JavaScript, as used by the browsers, is a client side technology. You'll need something on your server to bridge the gap between SQL Server and a JavaScript app. This is one of the big features that you get with ArcGIS Server.
with 10.1 you will have SDS for editing spatial data rdbms (the Spatial Database Server creates a geospatial REST interface with any tabular data stored in an RDBMS)