Forum Replies Created

Viewing 15 posts - 4,591 through 4,605 (of 5,394 total)

  • RE: view containing outer join dog slow

    Most of the query cost seems to be in the Key Lookup for DocDataField.FieldValueDateTime in the last outer join in the view.

    Try adding a covering index to avoid the lookup.

    I...

  • RE: Dynamic SQL Statement - Problem with Syntax

    Some of your variables are set to null along the way. Try to catch it with ISNULL.

    BTW, your code is prone to sql injection, I suggest that you revise it...

  • RE: OpenQuery

    Try with:

    SELECT *

    INTO [Server-B].[DB_Name].dbo.NewTable

    FROM #temp_table

    WHERE FILE_NAME = 'DBName..NewTable'

    The reason your OPENQUERY fails is that #temp_table is a temporary table, visible only on Server-A in the session that created it. No...

  • RE: OPENROWSET and OPENQUERY

    Let's see what BOL states:

    OPENQUERY Executes the specified pass-through query on the specified linked server.

    This means that OPENQUERY can be used to execute a query on a remote linked server...

  • RE: Are the posted questions getting worse?

    Paul White (2/11/2010)


    Gianluca Sartori (2/11/2010)


    Paul White (2/11/2010)


    🙁 sigh :([/url]

    Why so sad, Paul?

    The 'sigh' is a link to today's featured article. I'm away from home an unable to reply as...

  • RE: Are the posted questions getting worse?

    Paul White (2/11/2010)


    🙁 sigh :([/url]

    Why so sad, Paul?

  • RE: Help - syntax error on Group By

    It's interesting to note that your original syntax doesn't fail in SQL 2005.

    Very strange.

  • RE: Help - syntax error on Group By

    Try this way:

    select 'Year ending '+ job_date

    +' revenue was '+ job_cost

    from (

    select cast(year(job_date) as varchar(4)) as job_date,

    cast(sum(job_cost) as varchar(20)) as job_cost

    from job

    group by cast(year(job_date) as varchar(4))

    ) AS data

  • RE: Administration

    You can get the jobs scheduled in the time window you like with something similar to this:

    ;WITH schedules AS (

    SELECT *, sTime = REPLACE(STR(next_run_time,6),' ','0')

    FROM msdb..sysjobschedules

    WHERE next_run_date > 0

    ),

    dt_schedules...

  • RE: Restoring Database without .mdf on SQL Server 2005

    Yes: a database full backup is suitable for that purpose.

    Do you have any?

  • RE: Administration

    What do you mean exactly with "flags"?

  • RE: DBCC Timewarp

    Is any of you willing to help this OP with the correct syntax to get his DB back? I don't remember all the parameters right now...

  • RE: Restoring Database without .mdf on SQL Server 2005

    No, I'm sorry. You should have a backup.

  • RE: Are the posted questions getting worse?

    Roy Ernest (2/9/2010)


    Steve, There is no need for any apology...:-) You cannot control what others write or how others behave. Thanks for removing the comment though. It wont look good...

  • RE: DBCC Timewarp

    john.arnott (2/9/2010)


    I think I've found a set of universes in which TSQL cursors and while-loops are nearly always demonstrably faster than set-based logic.

    Is Jeff in that universe writing...

Viewing 15 posts - 4,591 through 4,605 (of 5,394 total)