944,141 Members | Top Members by Rank

Ad:
  • MS SQL Discussion Thread
  • Marked Solved
  • Views: 4230
  • MS SQL RSS
Oct 27th, 2009
0

How to Create database in SQL Server using Javascript & HTML?

Expand Post »
Hello,

I want to create database on SQL Server using Javascript and HTML. User will input following data. Server Name, Database name, File Sizes. When I will click "Submit" button database should be created on Selected server with entered name. I am using Client side HTML and Javascript.
we need to create database according to some standards thus we are preparing graphical user interface.
Quick response will be appreciated.

Thanks, Rahul
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Rahul002 is offline Offline
2 posts
since Oct 2009
Oct 28th, 2009
0
Re: How to Create database in SQL Server using Javascript & HTML?
I dont think you can do that, you are going to need a server side language, like ASP, Java, PHP etc that will be able to communicate with the database.
Reputation Points: 36
Solved Threads: 57
Posting Whiz
Thirusha is offline Offline
355 posts
since Mar 2008
Oct 29th, 2009
0
Re: How to Create database in SQL Server using Javascript & HTML?
@Thirusha correction, you can do DB connectivity with AJAX which is essentially JavaScript
Last edited by peter_budo; Oct 29th, 2009 at 4:22 pm.
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 874
Code tags enforcer
peter_budo is offline Offline
6,659 posts
since Dec 2004
Oct 30th, 2009
-1
Re: How to Create database in SQL Server using Javascript & HTML?
Click to Expand / Collapse  Quote originally posted by Rahul002 ...
Hello,

I want to create database on SQL Server using Javascript and HTML. User will input following data. Server Name, Database name, File Sizes. When I will click "Submit" button database should be created on Selected server with entered name. I am using Client side HTML and Javascript.
we need to create database according to some standards thus we are preparing graphical user interface.
Quick response will be appreciated.

Thanks, Rahul
Impossible. Javascript is not designed to do work on another server, it is client side software that only runs on the client. Both HTML and JavaScript can post to a cgi which could do something like this. If the server name entered also hosts the cgi, Javascript could post the instructions to the server name's cgi and let it do the work. That or the client hosts the cgi and the user account has access to the server name.
Reputation Points: 14
Solved Threads: 12
Junior Poster
kplcjl is offline Offline
146 posts
since Sep 2009
Nov 3rd, 2009
0
Re: How to Create database in SQL Server using Javascript & HTML?
@Peter_budo, based on his question, i think that i am correct in saying that it cant be done, one can use ajax, but you will still need a server side language, one cannot connect directly to the database just using javascript.
Reputation Points: 36
Solved Threads: 57
Posting Whiz
Thirusha is offline Offline
355 posts
since Mar 2008
Nov 3rd, 2009
-1
Re: How to Create database in SQL Server using Javascript & HTML?
We may never know as Rahul002 was so rude as to never reply what he/she is up to...
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 874
Code tags enforcer
peter_budo is offline Offline
6,659 posts
since Dec 2004
Nov 3rd, 2009
0
Re: How to Create database in SQL Server using Javascript & HTML?
Click to Expand / Collapse  Quote originally posted by peter_budo ...
@Thirusha correction, you can do DB connectivity with AJAX which is essentially JavaScript
Sorry, I forgot about AJAX. It isn't just JavaScript. It is a combination of JavaScript and XMLA. One of the key phrases in the AJAX tutorial is "AJAX uses the XMLHttpRequest object". This is, in effect your cgi link I was talking about. The intent in the tutorial was to connect to a server that had your DB interface already built.
I assumed that the request was to create a database on the client since JavaScript is and remains client-side code only. I can't think of any valid reason for creating a database on the server-side. If he is dead-set on creating a DB on the client side, I suppose it is possible using AJAX, I still say it is impossible using JavaScript. You would need an unnamed SQL Server object running on the client, the person running the web page would need admin rights on SQL, you would connect using the local IP address, verify the DB doesn't exist on the client server and create it.
I sincerely hope and pray that using AJAX to create a DB on my server is impossible as well. I hate to think what a set of malware could do to me being able to connect to me, as me, just by setting up a web page. I hate what they can do now that requires a constant update of sentry software.
Last edited by kplcjl; Nov 3rd, 2009 at 4:47 pm. Reason: clarify statement
Reputation Points: 14
Solved Threads: 12
Junior Poster
kplcjl is offline Offline
146 posts
since Sep 2009
Nov 3rd, 2009
0

Thanks

Click to Expand / Collapse  Quote originally posted by peter_budo ...
@Thirusha correction, you can do DB connectivity with AJAX which is essentially JavaScript

Hello,

Thanks for your response. My requirement was to create database on SQL 2005 Server with my local machine using any language. But we cant use any application server for this, Hence i wanted to do this using client side scripting. I will find is AJAX suitable for this sceneario or not. I really appreciate your efforts.

Thanks,
Rahul
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Rahul002 is offline Offline
2 posts
since Oct 2009
Nov 5th, 2009
0
Re: How to Create database in SQL Server using Javascript & HTML?
Again, I sincerely hope you find it is IMPOSSIBLE to put a DB on my SQL server if I happen to link to your web site. There are enough security holes to drive a mack truck through without adding this one to it.
I'm kind of conflicted because I usually don't want someone to fail in their endevours, but I definitely hope you fail.
Reputation Points: 14
Solved Threads: 12
Junior Poster
kplcjl is offline Offline
146 posts
since Sep 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MS SQL Forum Timeline: Cute: I need to remove the db_backupoperator permissions from the db_owner role.
Next Thread in MS SQL Forum Timeline: LEFT JOIN problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC