Why?

This is for DB maintenance tasks.  If you make an alteration to a table,
moving a field position for example, then Enterprise Manager can
sometimes make quite a long script with transactions, temporary tables
and lots of GO statements.

Yes, I suppose I could split it up into lots of separate CFQUERYs,
surrounding the lot with CFTRANSACTION, but it seems easier to me and
much less error prone to just be able to run the script itself.



"Robertson-Ravo, Neil (RX)" wrote:
>
> What does the script do?  You should be able to just use cfquery unless it's
> using some non-supported SQL.
>
>
>
>
>
>    _____
>
> From: Richard Meredith-Hardy [mailto:[EMAIL PROTECTED]
> Sent: 01 October 2004 13:00
> To: CF-Talk
> Subject: running MSSQL scripts
>
>
>
> I'm struggling here
>
> What I would like to do is load a MSSQL script created in Query Analyser
> or Enterprise manager onto the server and then run it from CF5.
>
> making and loading the .sql file is easy.  Running it is another matter.
>
> I've tried creating a sp which runs xp_cmdshell @st   where @st is a
> complete osql string.  This works but being a 2 stage process it seems
> to be difficult to get any meaningful feedback if there is a problem in
> the script.
>
> sp_executesql seems to be a better option but how to read the .sql
> file?
>
> This must be a common thing people need to do?
>
> --
> Regards;
>
> Richard Meredith-Hardy
> -------------------------------------------------------------
> r[dot]mh[at]flymicro[dot]com
> Tel: + 44 (0)1462 834776 FAX: + 44 (0)1462 732668
>
>    _____
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to