Forum Replies Created

Viewing 15 posts - 12,826 through 12,840 (of 14,953 total)

  • RE: update from

    The wording. They should do the same thing.

  • RE: the maximum number of prefixes. The maximum is 2

    First, make sure your linked server is set up correctly.

    Second, create a synonym (look up "create synonym" in Books Online) for the the table.

    Third, use the synonym in the insert...

  • RE: Re: Database Comparison

    Well, you could do a join between various system views.

    For example, if you want every proc/function/view that's different, you could do:

    select s1.[object_id]

    from server1.database1.sys.sql_modules s1

    left outer join server2.database2.sys.sql_modules s2

    ...

  • RE: coalesce negative values

    True.

  • RE: getting wrong day

    Try this, see if it does what you need:

    select

    case

    when datepart(day, getdate()) <= 15 then

    dateadd(day, -1 * datepart(day, getdate()), dateadd(month, -1, getdate())) + 1

    else

    dateadd(day, -1 * datepart(day, getdate()), dateadd(month,...

  • RE: coalesce negative values

    He's looking for a binary. Otherwise Sign would work. Possible that he can change his requirement, of course.

  • RE: Get rid of cursors

    Okay. If you can let me know what I missed, I'll see if I can fix it.

  • RE: Get rid of cursors

    The original proc is using cursors instead of joins in many places. I tried to figure out from the cursors what the equivalent join would be, but I'm not...

  • RE: Storage Planning

    Just keep in mind that RAID-5 will have lower performance than RAID-10 on this kind of database. Also, because of the constant drive thrashing, there is some evidence that...

  • RE: Connect to SQL Server 2005 over VPN

    When I've connected through VPN, I've had to remote-desktop to the server to get Management Studio to connect to the database.

  • RE: Get rid of cursors

    Okay, so which of the joins isn't correct? I can't tell from here, because none of the sample data given returns any rows at all, even with the original...

  • RE: Data Type change goofup

    Glad that worked out for you.

  • RE: Selecting 12 months of data for utility bills

    Try this:

    ;with

    FirstDate (FDate) as

    (select min(startdate) -- First meter date

    from #meters),

    MeterYears (SDate, EDate) as -- Meter start and end dates

    (select

    dateadd(day, -1 * datepart(day, getdate()),

    dateadd(day, datediff(day, 0, dateadd(year, -1, getdate())),...

  • RE: Get rid of cursors

    Try this:

    declare @AuditID int

    select @auditid = 27039

    ;with PreviousAudit (Score) as

    (select [value]

    from dbo.Audits_InspectionItems

    inner join dbo.Audits_ItemsScore

    on Audits_InspectionItems.ItemID = Audits_ItemsScore.AuditInspectionItemID

    where auditid =

    (select top 1 paudit.AuditId

    from dbo.Audits PAudit -- Prior audit

    inner join...

  • RE: Many-to-Many relationships with foreign key constraints?

    Triggers are the only way I can think of to comply with all of the stated needs.

Viewing 15 posts - 12,826 through 12,840 (of 14,953 total)