Forum Replies Created

Viewing 15 posts - 2,191 through 2,205 (of 5,504 total)

  • RE: URGENT: SQL Pivot Help Please!

    Please have a look at the CrossTab and DynamicCrossTab articles referenced in my signature.

    The CrossTab version for your last query would look like

    SELECT PA_EnterpriceID

    ,MAX(CASE WHEN [Top 10]=1 THEN PP_NAME ELSE...

  • RE: Trust People

    To quote the editorial:

    and then let them bend rules, change procedures where it counts

    The question is: Who's going to decide whether it counts or not?

    Scenario 1:

    You're a DBA and a...

  • RE: 11 columns uniquely identify a record......primary key?

    Another option:

    Extract those 12 columns into a separate table with an identity column and replace the 12 columns in your original table with the id of the new table.

  • RE: Is there a way to do this without a cursor/loop to process individual records?

    Understood. Just wanted to make sure.

    Regarding your performance concern:

    As long as you're not running this code with hundred thousand of rows from your source table during peak hours, you should...

  • RE: insert error with computed column index

    May I recommend a minor change?

    Change the data type of @vCommand in your sproc to NVARCHAR(MAX)?

    The data type text is marked as deprecated starting with SS2K5.

  • RE: Are the posted questions getting worse?

    GSquared (1/5/2011)


    ...

    Are you trying to imply that a lump of plastic, metal, and toxic semiconductors can't understand that it's supposed to do what I want, not what I told it...

  • RE: trigger update and compare string !?

    Here's a setup to play with including some tests to check whether a sproc will be fired or not.

    USE tempdb

    GO

    if object_id('temp','U') is not null drop table temp

    CREATE TABLE temp( idCourse...

  • RE: Pivot Query Modifications

    joshtheflame (1/5/2011)


    is there any other way ?

    SQL side: Yes.

    Please check if you can Edit:call a SQL stored proc from .NET that will return a dataset (don't know, I'm still a...

  • RE: Pivot Query Modifications

    joshtheflame (1/5/2011)


    Well can we achieve the same result with different approach as i am stuck with this dynamic thing and .NET DATA set requirement is column in Select statement ..somehow...

  • RE: Pivot Query Modifications

    joshtheflame (1/5/2011)


    Lutz,

    Can we do the same with different technique? I mean one simple select with all the 32 desired columns?

    What do you mean by "the same" and "desired columns"?

    Are you...

  • RE: Need to Distinct t Particular column result

    First of all, I apologize for assuming the task being homework... 😉

    Using tommy's Tally table approach, here is a set based solution:

    ;WITH

    a1 AS (SELECT 1 AS N UNION...

  • RE: sql for branch Wise report

    joshtheflame (1/5/2011)


    Lutz,

    I got stuck in a really nasty situation with the dynamic query in my previous thread. If I run the procedure it sure populates the column and display them...

  • RE: Pivot Query Modifications

    copied from another thread:

    I got stuck in a really nasty situation with the dynamic query in my previous thread. If I run the procedure it sure populates the column and...

  • RE: trigger update and compare string !?

    Your approach will only compare the first updated value, whereas "first" is equal "first random" in this case since there is no ORDER BY.

    When you use triggers always make sure...

  • RE: Is there a way to do this without a cursor/loop to process individual records?

    Did you talk to the vendor regarding your attemt? They might not provide support as soon as you start bypassing their software...

Viewing 15 posts - 2,191 through 2,205 (of 5,504 total)