PDA

View Full Version : dynamicallly change the .LDF/.MDF filepath in sql script



karthik_mcc
07-20-2004, 01:58 AM
Hi,
The following is my requirement.

I am developing a web project setup which will be installed in the application server. I have included a sql script (SQL SERVER 2000) along with the setup.

My problem is that the database server (SQL SERVER 2000) is a different machine. But in my script the .LDF and .MDF path are hardcoded. This FILEPATH has to be obtained from the user dynamically.

I created a custom dialog with one textbox within which the user can enter the file path.

But my problem, is how do i dynamically replace the path in the sql script with the FILEPATH entered by the user.

thanks,
karthik.

Marwan
07-20-2004, 04:39 PM
Did you try defining entries in the Script's Text Replacement Tab using text substitutions?

karthik_mcc
07-20-2004, 09:53 PM
Hi,
Thanks for the reply...

It works good...

regards,
karthik.

aarondodd
10-19-2004, 03:45 PM
I too wish to do this, and I have a custom dialog that succesfully gets input from a user and assigns it to a variable. However, I do not know how to use that variable in the Text Replacement's screen. If I enter the variable name, i.e. "szMDFPath" what I get is "szMDFPath" replacing my text, not the value of said variable.

Thanks.

karthik_mcc
10-19-2004, 11:20 PM
I am not sure how to do it in Install script project. In windows installer project, you just have to refer the property name.