Viewing 15 posts - 106 through 120 (of 2,169 total)
It's a presentation issue!
Store the data using DATETIMEOFFSET, DATETIME2(3) or similar datatype.
Then add a calculated columns (persisted?) for the visual representation you desire.
August 25, 2011 at 2:59 am
Also see here to remedy the encoding feature http://weblogs.sqlteam.com/peterl/archive/2009/03/05/Extract-XML-structure-automatically.aspx
And here is how you can filter out certain nodes
http://weblogs.sqlteam.com/peterl/archive/2009/06/04/Extract-XML-structure-automatically-part-2.aspx
August 24, 2011 at 1:14 pm
You can somewhat simplify the NaN check by adding NULLIF to the formula for not having to do the & and / operation twice.
ALTER FUNCTIONdbo.fnBinaryReal2Real
(
@BinaryFloat BINARY(4)
)
RETURNS REAL
AS
BEGIN
RETURNSIGN(CAST(@BinaryFloat AS INT))
* (1.0...
August 24, 2011 at 2:10 am
Change
BEGIN
SET @ActionType = 'UPDATE'
UPDATE Activities
SET
Description = i.Description,
UpdateDate = i.UpdateDate,
UpdatedBy = i.UpdatedBy
FROM Activities a, inserted i
WHERE a.ActivityId=i.ActivityId
IF @@ERROR <>0
BEGIN
RAISERROR('FAIL TO...
August 18, 2011 at 2:46 pm
Use ROW_NUMBER() function and partition by AssetID and HuboMeter. ORDER BY according to your business needs.
Then do a SELECT from the query above and use the value from the row_number...
August 8, 2011 at 11:00 pm
DELETE f
FROM (
SELECT ROW_NUMBER() OVER (PARTITION BY FirstName, MiddleName, LastName ORDER BY DateLoaded) AS recID
FROM dbo.Table1
) AS f
WHERE recID > 1
August 8, 2011 at 1:44 pm
The behaviour change is documented here in Books Online
http://msdn.microsoft.com/en-us/library/ms143359(v=SQL.100).aspx
August 8, 2011 at 1:41 pm
Here is one algorithm to get the correct pattern
SELECTv.Number,
f.Position
FROMmaster.dbo.spt_values AS v
CROSS APPLY(
VALUES(0, 4 * v.Number - 3),
(1, 4 * v.Number - 1),
(2, 4 * v.Number - 2),
(3, 4 * v.Number...
August 4, 2011 at 12:19 am
Let's see this in a "stack view".
--1 a.col1 = b.col1
--2 ...
August 4, 2011 at 12:03 am
I am just trying to establish if you want a certain dialect of RPN or not.
My suggested statement is a valid RPN notation and will create the same result as...
August 3, 2011 at 9:41 pm
Why not this? And enabling shortcurcuit?
--3 a.col1 b.col1 = a.col2 b.col3 = AND a.col4 b.col4 = AND
August 3, 2011 at 1:49 pm
Are you using a recursive CTE? In that case, the table spool is inevitable.
August 3, 2011 at 1:47 pm
I just couldn't resist...
SELECTMIN(CASE WHEN Value = 0 THEN NULL ELSE ID END),
AVG(CASE WHEN Value = 0 THEN NULL ELSE 1E * Value END)
FROM#Temp
August 2, 2011 at 1:54 am
PLEASE reconsider your design. You are breaking one of the most important rules of database design; normalization.
August 2, 2011 at 1:50 am
It worked for me, but I realize I had to make it even more simple for you.
Check this out.
DECLARE @XML XML,
@NodeNumber INT,
@NewValue VARCHAR(20)
SET@XML = '<Accounts>
<subAcc>
<Name>EmpID</Name>
<Value>234</Value>
</subAcc>
<subAcc>
<Name>EmpName</Name>
<Value>Test</Value>
</subAcc>
<subAcc>
<Name>EmpDOJ</Name>
<Value>3/31/2011</Value>
</subAcc>
<subAcc>
<Name>EmpDept</Name>
<Value>IT</Value>
</subAcc>
</Accounts>'
SELECT@NewValue = '04/28/2011',
@NodeNumber = 3
SET@XML.modify('replace value...
July 31, 2011 at 9:58 pm
Viewing 15 posts - 106 through 120 (of 2,169 total)