Viewing 15 posts - 691 through 705 (of 1,082 total)
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...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
September 1, 2008 at 9:16 am
HI there,
Try and see what you can come up with by using a dynamic pivot query
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
September 1, 2008 at 9:04 am
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...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
September 1, 2008 at 8:50 am
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
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
September 1, 2008 at 8:41 am
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...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
September 1, 2008 at 5:47 am
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...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
September 1, 2008 at 5:06 am
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...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
September 1, 2008 at 4:22 am
Could you give me an example please, of what the result will look like if you have the same Code?
Thanks
CHris
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
September 1, 2008 at 3:30 am
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...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
September 1, 2008 at 3:17 am
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
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
September 1, 2008 at 3:08 am
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...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
August 29, 2008 at 9:05 am
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
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
August 28, 2008 at 8:44 am
Sorry my bad.
Forgot to see which version of SQL you using.
CTE's are not allowed in 2000 🙁
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
August 28, 2008 at 6:50 am
HI There,
TRy and look up the Use of CTE's, this should point you in the right direction.
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
August 28, 2008 at 6:45 am
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...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
August 28, 2008 at 4:21 am
Viewing 15 posts - 691 through 705 (of 1,082 total)