Forum Replies Created

Viewing 15 posts - 691 through 705 (of 1,082 total)

  • RE: Sysobjects (xType vs Type)

    HI All,

    It seems that xType is what should be used, Type is there for backward compatibility

    If this is not 100% correct please let me know.

    P.S the only value differences are...

  • RE: Query to pivot the values.

    HI there,

    Try and see what you can come up with by using a dynamic pivot query

  • RE: Database Design Question

    Hi again,

    Ok seeing as though you have to have a new table, and I'm with Steve in that I trig avoid triggers where I can.

    Then I would prob suggest that...

  • RE: Database Design Question

    Hi there,

    Is the Username --> Profile relationship a one-to-many or a one-to-one?

    Also is it possible for a Username to exist without a Profile and visa versa?

    Thanks

    Chris

  • RE: Merging rows

    Hi There,

    Try this:

    DECLARE @Table TABLE

    (Person VARCHAR(2),

    name VARCHAR(10),

    age VARCHAR(3),

    height VARCHAR(3))

    INSERT INTO @TABLE

    SELECT '1', 'John', NULL, NULL UNION ALL

    SELECT '1', NULL, '30', NULL UNION ALL

    SELECT '1', NULL, NULL ,'192'

    SELECT *

    FROM @TABLE

    SELECT

    MAX(Person),

    MIN(Name),

    MIN(Age),

    MIN(Height)

    FROM...

  • RE: Got Error when executing script.

    HI there,

    SELECT iTableFieldId,@iMenuId=iMenuId,@vFieldsName=vFieldsName,@iDataTypeId=iDataTypeId,

    @iFieldLength=iFieldLength,@bIsPrimary=bIsPrimary,@bIsIdentity=bIsIdentity,

    @bIsNull=bIsNull,@vDefault=vDefault,@bArchive=bArchive

    FROM TableField

    WHERE iTableFieldId=@iTableFieldId

    In the above line of code, you are assigning values to variables but you...

  • RE: Query to pivot the values.

    Hi there,

    OK I am assume this is what you want.

    DECLARE @myTable TABLE

    (ITEM_CODE INT,

    DPL_CODE VARCHAR(10),

    MAX_AMT INT)

    INSERT INTO @myTable

    SELECT 1,'VP-LISO',3000 UNION ALL

    SELECT 1,'XP-CMO',5000 UNION ALL

    SELECT 1,'MP-COM',1500 UNION ALL

    SELECT 2,'VP-LISO',3000 UNION ALL

    SELECT 3,'XP-CMO',5000...

  • RE: Query to pivot the values.

    Could you give me an example please, of what the result will look like if you have the same Code?

    Thanks

    CHris

  • RE: Query to pivot the values.

    Sorry also,

    How do you want to Aggregate MAX_AMT?

    For Example if you have you Multiple rows with the same DPL_CODE , should the query add the MAX_AMT's together? or take...

  • RE: Query to pivot the values.

    Hi there,

    Try looking up the PIVOT funtion in BOL.

    If you still having problems let us know and we help you with your code.

    Thanks

    Chris

  • RE: how can a simple join be so mysterious

    HI there,

    I'm not sure if it's a typeO or not but you ON conditions are not the same

    ON agrt778.prd = itdmn78.prodno

    ON itdmn78.PRDNO = agrt778.prd

    Please could you also supply us with...

  • RE: combine resultset values to one

    HI There,

    I just learnt this today.

    [Code]

    DECLARE @Result VARCHAR(1000)

    SELECT @Result = Col1 + ',' + ISNULL(@Result ,'')

    FROM YouTable

    SELECT @Result

    [/code]

    Hope that helps

  • RE: Query Request

    Sorry my bad.

    Forgot to see which version of SQL you using.

    CTE's are not allowed in 2000 🙁

  • RE: Query Request

    HI There,

    TRy and look up the Use of CTE's, this should point you in the right direction.

  • RE: swap data between 3 fields?

    HI Mike,

    Well I guess if you know the name of the table then you will probably have to use dynamic SQL to get the column names to build an update...

Viewing 15 posts - 691 through 705 (of 1,082 total)