Forum Replies Created

Viewing 15 posts - 1,351 through 1,365 (of 1,473 total)

  • RE: cross-referencing values

    Thanks for the creation scripts. Is there any reason you can't simply do this?

    [font="Courier New"]SELECT DISTINCT *

    FROM ptAppointments P

           INNER JOIN coApptResources C ON LTRIM(RTRIM(REPLACE(REPLACE(REPLACE(P.Location,'-SOUTH',''),'-NORTH',''),'CHRISTOPHER J ',''))) =...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: wants to add an integer value to a column which is char type.

    What issues are you running into in your attempt that you need help with?

    declare @c char(2),

    @d char(2)

    set @c = '01'

    set @d = '10'

    select @c + 7, @d + 7

    Results:

    8...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: sp_execute returns error

    You are trying to execute a dynamic sql statement with the variable actually in the statement. Usually, when you use dynamic sql you'd do something like

    SET @sql = 'Select...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Selecting more recent child record with parent

    SQL 2000 Version:

    [font="Courier New"]SELECT I.*, V.*

    FROM Items I    

       INNER JOIN Versions V ON I.Ref = V.Item_Ref

       INNER JOIN (SELECT Item_Ref, MAX(Ref) Ref FROM Versions GROUP BY Item_Ref) V2 ON...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Find and Replace Script Needed

    Yes, but he also wants to replace B100 with B98, so as long as he does that replace first, he should be fine in that particular case. However, it...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Help needed in removing dynamic SQL

    There definitely wouldn't be any manual typing in. It would all be check boxes or drop downs. However, because it's on the internet, I'm not necessarily happy with...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Help needed filling in values based on previous row

    Jeff Moden (10/16/2008)


    Garadin (10/15/2008)


    While my subquery seems to fit all that criteria, I'm not sure that it's creating a triangular join in this case. The subquery method is blazingly...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Sproc to upd tbl in a different server

    Assuming you are using linked servers, you should just be able to replace:

    Update Mytable

    Set Myfield = MyData

    FROM Mytable

    WHERE MyCriteria = Something

    With

    Update Server2.Database2.dbo.MyTable

    Set Myfield = MyData

    FROM Server2.Database2.dbo.MyTable

    WHERE MyCriteria = Something

    You don't...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: SPROC works way slower than SELECT statement

    We noticed something similar in attempting to do cross server queries with views. I believe the difference comes in because doing it one way will pull the entire dataset...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: SQL COMPLEX QUERY - Urgent

    Yep, those were the answers I was expecting. The above query should work fine.

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: SQL COMPLEX QUERY - Urgent

    Just saw your edit. Try this one:

    [font="Courier New"]DECLARE @Language   VARCHAR(10)

    SET @Language = 'JP'

    SELECT DISTINCT T1.ID, COALESCE(T2.Name, T3.Name) Name, COALESCE(T2.Description, T3.Description) Description,

           COALESCE(T2.Language, T3.Language) Language

    FROM #Table1 T1

       LEFT JOIN...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: SQL COMPLEX QUERY - Urgent

    Yeah, that changes things a bit. A few questions.

    You supply a language and return a row for each ID, attempting to grab the one for that language. If...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: SQL COMPLEX QUERY - Urgent

    That makes more sense. Thank you for the table definitions / inserts, it makes things much easier. (Although in the future, try to make sure they work 😉 )

    [font="Courier...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: How to run a .bat file on the second sql server, from DTS on the first sql server?

    PSExec ? (Part of PSTools) That's kinda a shot in the dark, I haven't tried it, as I don't do much with DTS.

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: SQL Server 2000

    You can handle it in many ways.

    A few are:

    Passing in the date to the table along with the values being updated from ASP, and updating it...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

Viewing 15 posts - 1,351 through 1,365 (of 1,473 total)