Viewing 15 posts - 3,901 through 3,915 (of 4,085 total)
Your pseudo-code doesn't have an explicit transaction defined and you didn't mention whether you had changed your transaction management mode, so I'm assuming that it's using the default which is...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 27, 2010 at 3:15 pm
WayneS (8/27/2010)
drew.allen (8/27/2010)
You may want to SET ROWCOUNT instead of using a TOP PERCENT.SET ROWCOUNT is on the deprecated list. Use TOP (n) instead.
I only suggested SET ROWCOUNT because I...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 27, 2010 at 12:34 pm
Actually, I was thinking about this last night, and because of the number of records you may want to do batch the processing. Here's one example. You would...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 27, 2010 at 8:29 am
I tend to use FOR XML to concatenate values together. In some cases, you can also use the quirky update.
Here is the FOR XML version.
if object_id('tempdb..#test') is not null...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 26, 2010 at 8:58 pm
If you want to return fields that you don't want to group on, a CTE with Row_Number() is often a good approach.
I changed your Table to a Table variable, but...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 26, 2010 at 8:14 pm
SwePeso (8/25/2010)
DECLARE@Sample TABLE
(
ID INT NOT NULL
)
INSERT@Sample
SELECT 1 UNION ALL
SELECT 2 UNION ALL
SELECT 3 UNION ALL
SELECT 4 UNION ALL
SELECT 6 UNION ALL
SELECT 7 UNION ALL
SELECT 9 UNION ALL
SELECT11
-- Get the missing...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 25, 2010 at 4:22 pm
The Stuff() formula is used to get rid of the extra comma.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 25, 2010 at 6:56 am
I've never used full-text search, but I think that it has the capabilities that you are looking for. It's certainly a good place to start.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 23, 2010 at 5:59 pm
Shorter is not always simpler. If you're going for shortest, then this is much more elegant.
SELECT DateAdd(Day
, Substring(@Source, 5, 3) - 1
...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 20, 2010 at 3:15 pm
You're returning a varchar field. Is there some reason that you don't want to return a datetime field?
When you assign your datetime field to your varchar field, you don't...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 20, 2010 at 9:45 am
Just because environment_key is the only field that the three have in common doesn't mean that's the field that you want to join on. All of my tables have...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 20, 2010 at 8:40 am
Chris Morris-439714 (8/18/2010)
WHERE PartitionSize IN (1, Seq*2, Seq*2-1) -- < changed 3rd param hereCheers
ChrisM
This makes it seem like 1 is a special case when it's actually an exemplar of...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 19, 2010 at 3:48 pm
khurram sultan (8/19/2010)
SELECTTb_item.Item_part_number ,
Tb_item.item_description,
(SELECT TOP 1 ISNULL(Stock, 0) FROM Tb_Item_Cost_Ledger WHERE (ItemId = Tb_Item.CoA_ID) AND (Vdate <= '20100101') ORDER BY Vdate DESC) as Stock
FROM ...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 19, 2010 at 11:00 am
Eugene Elutin (8/17/2010)
Will it be one-by-one...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 17, 2010 at 8:34 am
In looking over your trigger again, I noticed a couple of things. Since you declare your variable as varchar, it only holds the last value when you set the...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 16, 2010 at 3:40 pm
Viewing 15 posts - 3,901 through 3,915 (of 4,085 total)