Forum Replies Created

Viewing 15 posts - 2,176 through 2,190 (of 3,544 total)

  • RE: Stored Procedure and Batch File Problem

    Put

    ECHO Finished

    after last xcopy and before :Finish label and see if the text 'Finished' appears in the miss.log

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Stored Procedure and Batch File Problem

    Looks like your script is producing a prompt which cannot be catered for when using xp_cmdshell and will give you the symtoms described

    Do the files already exist in the destination...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Calculating percentages

    OK, OK, so a bit of a faux pas

    answer should have been  (426.0/852)*100 based on first post instead of correcting remi

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Calculating percentages

    wow we all got it right, a point to everyone, except remi of course

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Calculating percentages

    The int/int in brackets will result in int before the division by 100.0

    Try

    select (426.0/852)/100

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: removing repeating fields in result

    Sorry, some people might get offended (or I get beaten up by the moderator for using offensive language)

    Politely put

    Rubbish in, Rubbish out

    Only meant as a joke

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: removing repeating fields in result

    quoteI guess your query will fail.......

    Yep, c**p in, c**p out

    May need to change the subquery to

    (select count(*) from [#order] x where x.customerid=c.[id] and (x.[date]<o.[date] or (x.[date]=o.[date] and x.[time]<o.[time]))) AS...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: removing repeating fields in result

    If I have the ddl correct and you do not mind the results in updated date/time sequence then try

    SELECT CASE WHEN [suppress]=0 THEN [Order_ID] ELSE NULL END AS [OrderID],

    CASE WHEN...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Stored Procedure and Batch File Problem

    Try adding backslash to the end of the xcopy to tell the system the output refers to a directory

    eg

    xcopy /Q "c:\Inetpub\ftproot\adam\MisBack\Bais\%1.AIS" "c:\Inetpub\ftproot\adam\Mission"

    to

    xcopy /Q "c:\Inetpub\ftproot\adam\MisBack\Bais\%1.AIS" "c:\Inetpub\ftproot\adam\Mission\"

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: SELECT INTO statement

    Yes. As I said before I think you are pushing the limits of sp_executesql which has a limit of nvarchar(4000). EXEC allows you to concatenate several strings together e.g EXEC(@string1+@string2+@string3)...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: 4000 varchar field - efficient if 6 char or 600 used?

    We all can do that

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: SELECT INTO statement

    Simply, if possible I would add the Company key to the select statement, wrap the whole statement as a subquery and join the Company table at that point.

    I think you...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: 4000 varchar field - efficient if 6 char or 600 used?

    lol, nice one Farrell.

    About time someone got one up on remi

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: 4000 varchar field - efficient if 6 char or 600 used?

    quoteVarchar will only store the actual data...

    True.

    declare @test-2 varchar(4000)

    set @test-2='abc   '

    will only store 6 characters (plus small...

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 15 posts - 2,176 through 2,190 (of 3,544 total)