Forum Replies Created

Viewing 15 posts - 91 through 105 (of 920 total)

  • RE: Copy Tables to Another DB on Same Server - Error

    Just logging in to the domain doesn't get you anything in SQL Server. If your login gives you administrator rights on the box SQL Server is running on, you'd...


    And then again, I might be wrong ...
    David Webb

  • RE: Copy Tables to Another DB on Same Server - Error

    So, you need to either get permissions to create tables granted to the account you're using, or use another account that already has those permissions. Both those messages indicate...


    And then again, I might be wrong ...
    David Webb

  • RE: Copy Tables to Another DB on Same Server - Error

    Ok, so on to the next possible issue. Does the accout this is running under have permissions to create tables in the archive database? What is the exact...


    And then again, I might be wrong ...
    David Webb

  • RE: Copy Tables to Another DB on Same Server - Error

    So it will try to create your archive table in db1, since that's the DB it's operating in. Is that what you want? If your source and your...


    And then again, I might be wrong ...
    David Webb

  • RE: Copy Tables to Another DB on Same Server - Error

    The way your statement is written, the tables would be in the same database. You need to qualify them with db and schema:

    'SELECT * INTO db1_archive.dbo.tbl1_' + @thruPeriod +

    '...


    And then again, I might be wrong ...
    David Webb

  • RE: Find lowest populated field, not min value

    How about:

    select airport,

    thedate,

    case when delay1 <> 0 then 'delay1'

    ...


    And then again, I might be wrong ...
    David Webb

  • RE: Extract first numeric value from a string

    Sean has the best idea. His implementation will be far better behaved than the code I posted.


    And then again, I might be wrong ...
    David Webb

  • RE: Extract first numeric value from a string

    Sis,

    Provided you don't have '.' anywhere except as a decimal separator:

    alter FUNCTION dbo.fnExtractDigits (@inString VARCHAR(8000))

    RETURNS VARCHAR(8000) AS

    BEGIN

    DECLARE @X VARCHAR(100)

    Select ...


    And then again, I might be wrong ...
    David Webb

  • RE: Need help with the code

    What else does the job do? Are there other tasks it performs or other parts of the script that invokes the stored proc?


    And then again, I might be wrong ...
    David Webb

  • RE: Function return request

    Sorry, I may have misread the OP. You can't, as has been previously stated, do the dynamic SQL inside a function. Does this have to be in a...


    And then again, I might be wrong ...
    David Webb

  • RE: Function return request

    One way is to put the result into an already created temp table and select it after the 'exec'.

    DECLARE @sql varchar(max),@tablename varchar(max) = 'sys.syscolumns', @Results bigint

    create table #temp2 (maxid bigint...


    And then again, I might be wrong ...
    David Webb

  • RE: running package from TSQL

    What about giving them permissions to run sp_start_job?


    And then again, I might be wrong ...
    David Webb

  • RE: running package from TSQL

    How close to real-time does this have to be? Maybe you can just have the users post a 'request' to a table and have a job that runs frequently...


    And then again, I might be wrong ...
    David Webb

  • RE: The multi-part identifier error

    Not sure your join makes sense. You'll need to fill in the question marks below, but this removes the mixed join types:

    FROM S_OPERATION

    JOIN S_CUSTOMER SENDER

    ON S_OPERATION.SENDER_ID = SENDER.C_CUSTOMER_ID

    JOIN S_CUSTOMER...


    And then again, I might be wrong ...
    David Webb

  • RE: Bulk Copy.

    If the number of columns changes by row and the delimiters aren't constant, BCP is not really a good solution for this. You could bcp the whole row into...


    And then again, I might be wrong ...
    David Webb

Viewing 15 posts - 91 through 105 (of 920 total)