Viewing 15 posts - 2,746 through 2,760 (of 5,504 total)
You might want to try the CrossTab method described in the related link in my signature.
It's easier to read, usually performs better and is more flexible (easier to change to...
September 29, 2010 at 3:46 pm
Glad to help, Wayne 😀
SET DATEFORMAT MDY;
-- See how this starts off with a table and data in it?
-- If you had provided us the data in this format,
--...
September 29, 2010 at 3:41 pm
I would use a Windows scheduled task with the related sqlcmd.
September 29, 2010 at 3:32 pm
I would use a CTE together with ROW_NUMBER() OVER(PARTITION BY SensorID ORDER BY DateTime) AS row and do a self (outer?) join on it based on Sensorid and cte1.row=cte2.row-1
If you...
September 29, 2010 at 3:27 pm
Will something like this help:
SELECT *
FROM Students s
CROSS APPLY
(
SELECT
(
SELECT *
FROM Students t
WHERE t.DisplayName = s.DisplayName
FOR XML RAW
) x1
)x
September 29, 2010 at 2:49 pm
Something like this?
DECLARE @tbl TABLE
(
idtype CHAR(1), id INT, VALUE INT
)
INSERT INTO @tbl
SELECT 'A', 1 ,0 UNION ALL
SELECT 'B', 2 ,1 UNION ALL
SELECT 'B', 3 ,1...
September 29, 2010 at 1:06 pm
Would you please clarify your requirement? What would be the criteria to do the aggregation?
Based on your rather vague example it seems like you want to count the rows with...
September 29, 2010 at 12:49 pm
Using Perrys sample:
SELECT RIGHT(CONVERT(CHAR(8),@dtime,8),5)
September 29, 2010 at 12:36 pm
It depends.
What's the data type of routing?
As a side note: is there a specific reason for that heavy usage of IN clauses instead of joins or CTEs?
September 29, 2010 at 12:32 pm
You could convert it to integer to use it for aggregation:
MIN(CAST(YourBitCol AS TINYINT))
or the lazy-dev version:
MIN(YourBitCol + 0) -- force an implicit conversion
Edit: @Gail: the echo was not intentional...
September 29, 2010 at 12:22 pm
Steve Jones - Editor (9/28/2010)
LutzM (9/28/2010)
September 28, 2010 at 4:21 pm
Sounds like parameter sniffing[/url]. Please follow the link and read all three related articles. It's well worth it!
September 28, 2010 at 3:40 pm
mstevens92 (9/28/2010)
LutzM (9/27/2010)I know, the XML stuff looks weird compared to what we're used to... 😉
Probably doesn't help that I haven't touched SQL in about 6 months, been up to...
September 28, 2010 at 2:44 pm
Steve Jones - Editor (9/28/2010)
September 28, 2010 at 2:29 pm
CirquedeSQLeil (9/27/2010)
Even with an explicit deny on the table for update, delete, and insert as well as the denydatawriter - the user that...
September 27, 2010 at 5:58 pm
Viewing 15 posts - 2,746 through 2,760 (of 5,504 total)