Viewing 15 posts - 166 through 180 (of 532 total)
It's really surprising to me that so many people are suggesting "solutions" based on such an incredibly flawed design. I understand that sometimes you just need to get things...
July 30, 2010 at 12:27 pm
Steve, I would highly suggest that you read Jeff Moden's article on pivots and crosstabs[/url], especially the section on performance at the end. If you're not only using a...
July 29, 2010 at 6:46 pm
Having a table with a column of comma delimited values is very poor design. It really goes against the whole purpose of using a relational database.
The table should be...
July 29, 2010 at 3:22 pm
If you literally want exactly +6 months (including the hh:mm:ss) then ...
select DATEADD(mm, 6, GETUTCDATE())
Otherwise (if you just want the mm/dd/yy) then ..
select DATEADD(mm, 6, DATEADD(dd, DATEDIFF(dd, 0, GETUTCDATE()), 0))
July 29, 2010 at 3:16 pm
I generated some data to use as a test ...
CREATE TABLE #TEST
(recIDINT PRIMARY KEY
,theKeyVARCHAR(10)
,theYearINT
,theValue INT)
INSERT INTO #TEST
SELECT 1,'key 2',1934,50 UNION ALL
SELECT 2,'key 2',1935,30 UNION ALL
SELECT 3,'key 2',1936,96 UNION ALL
SELECT 4,'key...
July 29, 2010 at 3:06 pm
It's unclear from your post what your actual tables are and what your expected output is. Please see the link in my signature for information on how to post...
July 29, 2010 at 12:01 pm
Not sure that I exactly understand the question but take a look at this and see if it answers any part of your question ...
DECLARE
@n_TicketNoint,
@vc_Type varchar(1), --debit/credit
@vc_Entity varchar(10),
@d_Amount decimal(10,2))
--set variable...
July 29, 2010 at 11:57 am
Generally, my understanding is that it's better for performance to avoid UDF's and just do it inline:
SELECT u.ID,
Count(1) as Total, u.FirstName + ' ' + u.LastName as [Name],
convert(varchar(13),e.CreatedOn,120) + ':00:00'...
July 29, 2010 at 11:38 am
Rob Schripsema (7/29/2010)
July 29, 2010 at 11:14 am
Kit G (7/28/2010)
The question of what reality is is actually easily answered. Reality is what we agree it is. Change our agreement, change our reality.
Well this is the...
July 28, 2010 at 11:19 am
gah (7/28/2010)
update statement required somewhere?
The OP said
"Now the requirement is that when I get this whole data from Source, have to update all the indicator records where indicator =00000".
To...
July 28, 2010 at 10:57 am
You can also just use
SELECT visitor_cnt,
ROW_NUMBER() OVER (PARTITION BY visitor_cnt ORDER BY visitor_cnt) AS grp_seq_nbr
FROM @Visitors
July 27, 2010 at 6:52 pm
Wasn't trying to be overly critical ... just pointing out that the quirky update method isn't used for it's efficiency, it's used for when a regular set based approach won't...
July 27, 2010 at 4:24 pm
Ray K (7/26/2010)
What needs do you foresee for...
July 27, 2010 at 2:07 pm
Never been a Dicaprio fan myself but his latest films have been pretty solid ... Blood Diamond, The Departed (wow), Body of Lies and now Inception ... all very different...
July 27, 2010 at 1:56 pm
Viewing 15 posts - 166 through 180 (of 532 total)