Forum Replies Created

Viewing 15 posts - 46 through 60 (of 1,473 total)

  • RE: Trigger - for specific inserts only.

    You can't suppress the trigger entirely based on a condition like that... it's going to fire every time. But you could do that check as the first action of...

    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 convert row values to column values in Sql Server 2000

    Take a look at the article in my signature on cross tabs / pivots.

    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: The column prefix does not match with a table name

    You're using just moncall in your middle expression, not moncalladd or moncalldelete... that table isn't in your query.

    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: DateDiff with Months datepart - ILLOGICAL

    You have to stop thinking of it in terms of elapsed time, as Dave said. That's not what the calculation is intending to figure out. You can go...

    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 find out the sp query in the middle of execution

    You can get this via fn_get_sql (if you have the right SP, it's one of the hotfixes on sp2 or included in SP3). You can also use profiler.

    http://phelabaum.com/archive/2010/03/dbcc-inputbuffer-vs-fn-get-sql/%5B/url%5D

    If you're...

    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: Joining two tables via ODBC connection

    Have you tried creating a linked server to the pervasive db from your MS SQL Server db and doing the join using that?

    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: Group by

    Jeff Moden (3/11/2011)


    Lowell (3/11/2011)


    how about using the PARSENAME function to chop up the IP address?

    --using Stefan's setup:

    /*--Results

    (No column name)(No column name)

    1172.24

    322.25

    3223.25

    */

    SELECT Count(IPAddress),parsename(IPAddress,4) + '.' + parsename(IPAddress,3)

    FROM #tempIPTable

    Group By parsename(IPAddress,4) +...

    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: invalid length passed to substring with a subquery

    If I were to hazard a guess, it'd have to do with when the optimizer was choosing to apply the WHERE clause. It might be applying it before the...

    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: Need to your help - Query to display single column values into multiple columns (Cross tab Query)

    See the link in my signature on CrossTabs/Pivots. Great explanation of how to accomplish this there.

    Also, if you want people on the forums to help you write code, you'll...

    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: Getting Data from Oracle to Sql Server using Procedure

    You need to decide which fields you care about when they change. Instead of just joining based on client_code, maybe you want to join on client_code and Month, or...

    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: Detach trigger code

    drew.allen (2/10/2011)


    What I've done in these cases is use a TRY/CATCH block leaving the CATCH block empty.

    BEGIN TRY

    EXEC msdb.dbo.sp_send_dbmail <your parameters here>

    END...

    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: Getting Data from Oracle to Sql Server using Procedure

    The easy way: Delete any rows that match the criteria of the one you're about to insert before you insert it.

    The better way: Check to see if the row...

    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: Getting Data from Oracle to Sql Server using Procedure

    This syntax won't work for an object that doesn't already exist:

    insert into #AposGrpwisetemp

    Select @ReportNo ReportNo,* from AposGrpwisetest

    You'd instead need to do that like this:

    Select @ReportNo ReportNo,*

    into #AposGrpwisetemp

    from AposGrpwisetest

    That syntax...

    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: Incrementing an indentity column (not set in SQL as being identity)

    To my knowledge there's nothing standard that'd do that for you. I've written similar functions in the past to do incrementing that included letters. Here's one of them...

    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: Getting Data from Oracle to Sql Server using Procedure

    That table doesn't exist at the point that you're trying to select out of it. Check the following.

    Is it actually a "temp" table, (Preceded with #),

    Is...

    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 - 46 through 60 (of 1,473 total)