Forum Replies Created

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

  • RE: sp_send_dbmail error - Attaching files require an integrated client login

    Probably not what you want to hear, but this is from Books On Line:

    Database Mail uses the Microsoft Windows security context of the current user to control access to files....

  • RE: Pass variable to Openquery

    Yes, I agree.

  • RE: Pass variable to Openquery

    Re: "OpenQuery does not accept variables" --

    This runs fine in my set-up:

    Select * from OpenQuery(MyLinkedServer,'Declare @name varchar(50) Set @name=''RemoteDB'' Select * from sys.databases where name=@name')

    Note the declaration of the...

  • RE: Pass variable to Openquery

    I think the problem is that you are declaring the variable outside the query. Try putting everything into the OpenQuery:

    Select * from OpenQuery(TestServer,'declare @string varchar(max) Set @string=''abcd'' Select *...

  • RE: Built-in function date range

    lex9120,

    I'm not sure what you are looking for regarding the circumstance where the end date is earlier than the start date. But here's some code I've used in cases...

  • RE: error handling

    Doh!

    Yes, that's what I meant to say: Remove it from the Catch block and see what happens.

    Elliott

  • RE: error handling

    Eugene,

    Nothing was logged into your Error table because the ROLLBACK command in the TRY block cancelled the action. Try removing it and the error will log in your table...

  • RE: Getting NULL output against the column : completion_status

    Hi Sourav,

    Glad that lyou are making progress towards your goal.

    I don't have SQL Server open in front of me, so these comments are just observations, maybe correct, maybe...

  • RE: Getting NULL output against the column : completion_status

    A small point, but wouldn't the code by simplified by using the DateDiff function to compare the last backup date to today's date? There's no need to convert from...

  • RE: Select nn% from top & bottom over grouped data with sum

    Here is a general approach, which I'm sure you can improve.

    -- Declare variables to set exclusion ranges

    Declare @LowerOutlier decimal(4,2)

    Declare @UpperOutlier decimal(4,2)

    Set @LowerOutlier=0.05 -- adjust as needed

    Set @UpperOutlier=0.95 --...

  • RE: Enlisted or Drafted? Share your experience.

    I'm a volunteer. I got hooked in my first relational database class in college. The magic of pulling information out of a big pile of data turned me...

  • RE: Derived field help

    Hello again,

    Just a quick note:

    My (quick and dirty) solution does not act to alter the existing data, but to update the new column that the OP intends to add to...

  • RE: Derived field help

    Or, if you want to revise the view itself, try something like this:

    ;WITH cte as

    (Select [FinancialYr],[FinQtr],Count(FinQtr) as NumCount from vForecast group by [FinancialYr],[FinQtr])

    Update vForecast

    Set ForecastSpendPerQtr=f.[SpendPerFinYr($)]/cte.NumCount

    From vFin f JOIN cte ON...

  • RE: What If Mirror Server is Down-Any Impact on Production??

    Agreed. That's an important point. If the mirror is going to be down for long, it might be best to remove the mirroring (Alter Database MyDatabase Set Partner...

  • RE: What If Mirror Server is Down-Any Impact on Production??

    You didn't indicate there was a witness, so this answer applies to a non-witnessed set-up. If the mirroring session is in High Protection mode and the mirror database becomes...

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