Viewing 15 posts - 211 through 225 (of 355 total)
OK - if you are happy to ignore any time zone offsets and variations in time zone offset between different rows, and assuming that the date/time strings stored in your...
March 18, 2009 at 2:47 pm
I think the trick here is to start at the bottom (parts that don't have subcomponents) and work up.
WARNING: I haven't got access to SS2K5 right now so code below...
March 18, 2009 at 11:14 am
When I said local time, I meant the local time whereever the source data was generated, not where the SQL Server is located.
For your reporting, do you need the date/times...
March 18, 2009 at 9:51 am
SQL Server won't be able to implicitly convert the varchar strings like the following to the datetime data type.
'2009-01-27T14:32:37.7389657-08:00'
Having a mixture of different formats is one of the problems you...
March 18, 2009 at 8:32 am
Are all your date/times being stored as varchars in the following format?
yyyy-MM-ddTHH:mm:ss
e.g.
2008-09-01T09:00:01
If so, this is a standard (ISO 8601) format that should be reliably converted to a datetime whatever the...
March 17, 2009 at 6:03 am
Does this query do what you need?
It will only update rows for those shipments where the Drop_Or_Live column values are all 'DROP'.
CREATE TABLE #DropShipment (
Shipment int NOT NULL,
Stop int NOT...
March 16, 2009 at 3:29 pm
This will return the time difference including milliseconds. It will work fine if the time difference is guaranteed to be less than 24 hours.
However, if the time difference is greater...
March 16, 2009 at 7:46 am
The method I've used to construct the binary(20) key is as follows:
@UniqueID and @Group are apparently both hexadecimal strings. These are concatenated together and the concatenated hexadecimal string is then...
March 16, 2009 at 4:15 am
Are you sure?
My query is including results from 3 levels of the hierarchy.
I also worked out the results by hand and got the same results as the query.
March 14, 2009 at 2:55 pm
Thanks for providing the sample data and table structure.
Does this query give you the results you need?
;WITH cteSammel AS (
SELECT
1 AS [Level],
P.ProductID AS pid,
S.SalesPeriod AS sp,
S.Quantity...
March 14, 2009 at 2:32 pm
One option would be to use a recursive CTE to recurse through the hierarchy. Lookup SQL Server Bookes Online for an example. If you used this method you could eliminate...
March 14, 2009 at 8:10 am
Books Online says this about CTEs:
Specifies a temporary named result set, known as a common table expression (CTE). This is derived from a simple query and defined within the execution...
March 14, 2009 at 4:01 am
No need to loop.
This statement will insert all 89 rows in one transaction.
INSERT INTO [Registration]
([ContactID]
...
March 13, 2009 at 5:07 pm
Why couldn't they write t-sql more like C#
With the introduction of the LINQ language extensions to C# 3.0, you could argue that C# is borrowing some of the syntax of...
March 13, 2009 at 3:01 pm
If cursors were more convenient to use, you'd have people trying to use them even more than they currently do and destroying the performance of even more database servers.
March 13, 2009 at 2:39 pm
Viewing 15 posts - 211 through 225 (of 355 total)