Forum Replies Created

Viewing 15 posts - 1 through 15 (of 18 total)

  • RE: FTP file to a server

    After your PUT line - "select 'put ' + @files_path + @file ", do an MDIR to a local file.

    --> select 'mdir ' + @file + ' c:\temp\transfer.log'

    And on the...

  • RE: Wrong index chosen when variable in WHERE clause

    I had a similar problem this week.  Try the following.

    select distinct acct_num from h_svc where post_dt >= (select @lcDataDt)

     

    ~Steve

  • RE: xcopy syntax error

    Denise,

     

    Try exec master.dbo.xp_cmdshell 'dir \\hclltest\d$\prodbackup\*.*' to see if you get any a listing of the files successfully. 

    ~Steve

     

  • RE: xp_cmdshell can''''t execute VBS

    Pradeep,

    I don't think that you can make a web page open using this method.  My understanding is that only batch-type commands will run, not something visual or requiring user...

  • RE: xp_cmdshell can''''t execute VBS

    For me, the following works - EXECUTE master.dbo.xp_cmdShell 'cscript.exe \\asm8\c$\transf~1\transfer.vbs'

    I use cscript.

     

    ~Steve

     

  • RE: Select databases by a certain table

    To automate further you can use the sysDatabases table found in the master database to give you the list of all your databases.

     

  • RE: run exe by passing parameter in scheduled job

    The following works for me -

    EXECUTE master..xp_cmdshell '\\asm18\sys\appsdata\rentro~1\genera~1\mnprm.exe "ALL" "ALL" "9999"', no_output

    The EXE above receives 3 parameters...

    ~Steve

  • RE: Use cell in query

    Donavon,

    Your first step should be to get familiar with Microsoft Query.  In Excel, go to data, get external data, and then new database query.  Microsoft Query will start to open. ...

  • RE: Use cell in query

    In Microsoft Query, don't hard-code a criteria value but rather define the value as a "hint" surrounded with brackets - [age], for example, can be to get data back for a certain...

  • RE: sp_OAMethod Returns Empty String

    Eric,

    Whenever I have used sp_OAMethod I have only used 2 parameters - see below where I save and close an Excel spreadsheet...

    Steve

    ******************************

    --save and close Excel workbook

    EXECUTE @hr = sp_OAMethod...

  • RE: from MS Excel to SQL Server?

    Jacob,

    Try the following - just change machine name, folder and file name.

    SELECT *

    FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0',

    'Data Source="\\<<machine name>>\C$\temp\accounting.xls";User ID=Admin;Password=;Extended properties=Excel 8.0')...Sheet1$ AS s1

     

    --Steve

  • RE: use msdb to determine jobs that are currently running

    Scott,

    How about the following?  Just change your server in the OPENROWSET...

    --these are running jobs

    SELECT *

     FROM OPENROWSET('sqloledb',

        'server=ASM12;trusted_connection=yes',

        'set fmtonly off exec msdb.dbo.sp_help_job') WHERE current_execution_status <> 4

    Steve

  • RE: Store proc and his Spid ?

    I have a small script that I turn ON before I start a certain job that does INSERTS into a table.  The script does an INSERT every minute with the SELECT...

  • RE: report to check the result for 10 consucutive minutes

    Looking at the required result

    number name result start_date

    89277 xxxx no 8/11/05 5:12 AM

    89287 xxxx no 8/11/05 5:22 AM

    86405 xxxx yes 8/9/05 5:01 AM

    90000 xxxx no 9/9/04 5:15 AM

    Should the last...

  • RE: export to csv using t-sql

    I use xp_sendmail - here's an example that's TAB-delimited.

    DECLARE @tab    VARCHAR(10)

    SET @tab = CHAR(9)

    EXECUTE master.dbo.xp_sendmail

     @recipients = 'me'

     @subject = 'here is your data',

     @width = 1024,

     @attach_results = 'TRUE',

     @attachments =...

Viewing 15 posts - 1 through 15 (of 18 total)