hth since you (probably) don't want to overwrite your file each time, also take a look at using the <copy> task with the various filtering possibilities. It's the same (basic) idea, but instead of doing something like "first copy the base file, then use replace to specialize the copy" you wind up with "copy the base file and specialize it at the same time"
try something like: <copy file="cleanDB.sql.master" tofile="cleanDB.sql"> <filterset> <filtersfile file="${the.database.i.wanted.to.pass}.dist.properties"/> </filterset> </copy> <sql driver="com.microsoft.jdbc.sqlserver.SQLServerDriver" url="jdbc:microsoft:sqlserver://localhost\myinstance:1433;DatabaseName=$ {the.database.i.wanted.to.pass}" userid="sa" password="${the.password.of.the.database.i.wanted.to.pass}" src="cleanDB.sql" /> you'll have to find some character that doesn't occur in a 10000 line sql script to use as a token ;) oh, and that's not tested in any way, shape or form ;) /t >-----Original Message----- >From: Rizwan Merchant [mailto:[EMAIL PROTECTED] >Sent: Thursday, August 25, 2005 9:28 PM >To: 'Ant Users List' >Subject: RE: sql task sp_dboptions problem > >Hmmm...that <replace> looks like a good idea. Thanks... > >-----Original Message----- >From: RADEMAKERS Tanguy [mailto:[EMAIL PROTECTED] >Sent: Thursday, August 25, 2005 3:06 PM >To: Ant Users List >Subject: RE: sql task sp_dboptions problem > >wellllllllllllllll... (more than one way to skin a cat) > >if the cleanDB.sql file has db-specific references, you could >"specialize" this file before running it using the <replace> task. > >that would work if we're talking about changing names... it could be >made to work if we're talking about selectively executing only some >parts of the file, but it would get messy quite quick! > >/t > >>-----Original Message----- >>From: Rizwan Merchant [mailto:[EMAIL PROTECTED] >>Sent: Thursday, August 25, 2005 9:00 PM >>To: 'Ant Users List' >>Subject: RE: sql task sp_dboptions problem >> >> >>I don't think so, because the cleanDB.sql file still refers to >>a specific >>database. What I want to do is somehow pass a parameter to the >>cleanDB.sql >>file so that the file can be generic. >> >>-----Original Message----- >>From: RADEMAKERS Tanguy [mailto:[EMAIL PROTECTED] >>Sent: Thursday, August 25, 2005 2:51 PM >>To: Ant Users List >>Subject: RE: sql task sp_dboptions problem >> >>wouldn't this work? >> >> >><sql driver="com.microsoft.jdbc.sqlserver.SQLServerDriver" >> >>url="jdbc:microsoft:sqlserver://localhost\myinstance:1433;Datab >>aseName=$ >>{the.database.i.wanted.to.pass}" >> userid="sa" >> password="${the.password.of.the.database.i.wanted.to.pass}" >> src="cleanDB.sql" >> /> >> >>>-----Original Message----- >>>From: Moran Ben-David [mailto:[EMAIL PROTECTED] >>>Sent: Thursday, August 25, 2005 8:43 PM >>>To: 'Ant Users List' >>>Subject: RE: sql task sp_dboptions problem >>> >>>Sorry Razwan, >>> >>>I am not familiar with the <sql> task enough to help you on >>>that. However, >>>one thing I can suggest is that instead of using the tasks' >>>"src" attribute, >>>you put the sql from cleanDB.sql in you're ant file as such: >>> >>> >>><sql driver="com.microsoft.jdbc.sqlserver.SQLServerDriver" >>>url="jdbc:microsoft:sqlserver://localhost\myinstance:1433;Datab >>>aseName=on_de >>>velop" userid="sa" password="on_develop"> >>> >>> -- example code from cleanDB.sql >>> DROP DATABASE ${the.database.i.wanted.to.pass}; >>> >>></sql> >>> >>>Moran >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] >> >> > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]