master db code

  • I figured out

    Thank you

  • Krasavita (6/7/2011)


    Can someone please explain this codefor me, this code is under sql jobs and selected under certain db and I don't understand why, it is under user db and not under master.

    Thank you

    That code just checks to see if a file named SQLExtract_DONOTTOUCH.txt exists in the specified path.

    Then, if the file exists, it renames the file.

    I would normally expect some sort of an import process to happen next - are there parts of the code missing?

    -Ki

  • But

  • there's more to the job than you posted...this is all that was in the docx file you posted:

    set nocount on

    declare @ppdate datetime

    declare @sqlcmd nvarchar(4000)

    declare @cmdTxt nvarchar(4000)

    DECLARE @i int

    EXEC master..xp_fileexist '\\YourServerPath\SQLExtract_DONOTTOUCH.txt', @i out

    IF @i = 1

    begin

    exec master..xp_cmdshell 'rename \\YourServerPath\SQLExtract_DONOTTOUCH.txt SQLExtract_Complete.txt'

    end

    there's no code in THAT that references anything in a specific database...so as Kiara said, your not providing us with everything to diagnose the issue.

    I'd bet there is more code or an additional step that looks for a specific table in a specific database, that you took offline,s o it cannot work any more....

    [/code]

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply