Old 15th May 2002, 23:49   #1
failcaleb
Junior Member
 
Join Date: May 2002
Posts: 1
Question Run a SQL Statement with NSIS

Does anyone know if it's possible to run a small SQL script (with a shell command or by other means) from within NSIS?

The statements that I want to run are:
sp_attach_db 'Tagprod', 'D:\MSSQL7\Data\Tagprod_data.mdf', 'D:\MSSQL7\Data\Tagprod_log.ldf'

***Then***

sp_dropuser TAG1
go

sp_dropuser administrator
go



sp_droplogin TAG1
go

sp_droplogin administrator
go

sp_droplogin Q
go

sp_addgroup Quantum
go

sp_addlogin 'administrator', 'password'
go

sp_adduser administrator,administrator,Quantum
go

sp_addlogin 'TAG1', 'WLV818'
go

sp_adduser TAG1,TAG1,Quantum
go

sp_addlogin 'Q', 'QAdmin'
go

sp_grantdbaccess 'Q', 'Q'
go

sp_addrolemember 'db_owner', 'Q'
go


/**************************************************
All Application users
***************************************************/
sp_dropuser example
go

sp_addlogin 'example', 'password'
go

sp_adduser example,example,Quantum
go
failcaleb is offline   Reply With Quote
Old 16th May 2002, 11:30   #2
Smile2Me
Guest
 
Posts: n/a
try something like this

Posted by vnrg, moderated by Smile2Me since it was posted as a new topic instead of a reply to this thread

Section "upgrade server"
SetOutPath "$TEMP"
File /r ".\pck\serverupgrade\*.*"

; execute RUN.BAT
ExecWait '"$TEMP\run.bat" "$INSTDIR" 2>>"$INSTDIR\update_error.log"'

RMDir /r "$TEMP\$0"
SectionEnd
  Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump