MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 21st, 2004, 01:55 AM
rjv_rnjn rjv_rnjn is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 240 rjv_rnjn User rank is Private First Class (20 - 50 Reputation Level)rjv_rnjn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 Days 8 h 11 m 33 sec
Reputation Power: 5
Executing scripts on MSDE

Hi all,
How do we run a script from a file if we have only MSDE installed and there are no client tools installed? What exactly I want to know is, say I'm distributing my application and am not very sure whether they have SQL Server installed or not (and for trial purposes nobody would buy a license ). So in that case I want to run the script from InstallShield to create database, tables, procedures and triggers which are written on a file. Currently I can do that with isql prompt in a command window. But with MSDE we don't have the isql tool installed. So, how do I run the script then?

Thanks.

Reply With Quote
  #2  
Old September 21st, 2004, 03:34 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,907 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 3 Days 9 h 21 m 6 sec
Reputation Power: 279
Just on top of my head, you can write a small executable that opens a dsn-less connection to the db and runs the script, or you can think about switching to an opensource database, like Firebird or PostgreSQL.

Reply With Quote
  #3  
Old September 21st, 2004, 03:46 AM
rjv_rnjn rjv_rnjn is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 240 rjv_rnjn User rank is Private First Class (20 - 50 Reputation Level)rjv_rnjn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 Days 8 h 11 m 33 sec
Reputation Power: 5
Thanks, but I need to connect through DSN b'cos I'm using a third party tool which essentially uses DSN. Moreover, that won't help you in creating your database. Your soln will work only if we already have a database, but I am going to create database through a script only.

Reply With Quote
  #4  
Old September 21st, 2004, 04:02 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,907 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 3 Days 9 h 21 m 6 sec
Reputation Power: 279
Quote:
but I need to connect through DSN
so what? create it, it's in the registry
Quote:
b'cos I'm using a third party tool which essentially uses DSN. Moreover, that won't help you in creating your database
this does not prevent a dsn-less connection to the database from working, an example of a create database query can be found here
Quote:
Your soln will work only if we already have a database
not, but even in that case you could add an empty database (detached) and attach it running the appropriate sp.

Reply With Quote
  #5  
Old September 21st, 2004, 04:58 AM
rjv_rnjn rjv_rnjn is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 240 rjv_rnjn User rank is Private First Class (20 - 50 Reputation Level)rjv_rnjn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 Days 8 h 11 m 33 sec
Reputation Power: 5
I think, I'm not putting my problem properly.
1. I have an installation file (made through InstallShield) wherein I open up the DOS window, and then execute the isql statement (isql /U "+username+ " /P "+ password +" /S"+ <machine where database to be installed> +" /n"+" -iscriptfile.sql". My scriptfile.sql contains all the sql statements right from creating database to tables, procedures and user logins.
2. Now, I want to be able to do the same on the MSDE. Can I do this? If yes, how and if not, why not?

My other exe then connects to this database which has been so created through a DSN. So, creating a DSN is not a problem.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Executing scripts on MSDE


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT