Viewing 15 posts - 766 through 780 (of 2,007 total)
Jeff Moden (4/4/2012)
Craig,Does your Tally table have a clustered index on it? If not, that may explain the results you got.
Yep, clustered index with fill factor 100.
It's...
April 4, 2012 at 6:44 am
aitchkcandoo (4/3/2012)
April 4, 2012 at 2:35 am
Jeff Moden (4/3/2012)
April 4, 2012 at 1:25 am
--Fixed you sample data
SELECT [OBJECT],DEPENDENCY
INTO TABLE1
FROM (VALUES
('VIEW1','TABLE1'),
('VIEW2','TABLE2'),
('VIEW3','VIEW2'),
('VIEW4','VIEW3'),
('VIEW5','TABLE1'),
('VIEW3','VIEW1'),
('VIEW5','VIEW4'))a([OBJECT],DEPENDENCY);
--Best guess at what you want
WITH CTE AS (SELECT a.DEPENDENCY, a.[OBJECT], ISNULL([ORDER],0) AS [ORDER]
...
April 3, 2012 at 8:23 am
Qutip (4/3/2012)
I've been banging my head against a brick wall trying to figure out why?!
I have a table of Stores, a table of Transactions, transaction details and a Table...
April 3, 2012 at 7:28 am
I may be oversimplifying what you've said but. . .
You said. . .
Andy Hyslop (4/3/2012)
April 3, 2012 at 7:27 am
S_Kumar_S (4/3/2012)
I need a query(or function) that filter the names(column name) which have consecutive 3 alphabets. basically I want to filter out those garbage names. e.g. sabcmm has abc consecutive.So...
April 3, 2012 at 7:20 am
suresh0534 (4/2/2012)
[Q1 = Jan + Feb + Mar ][ Q3 = July + Aug + Sept]
I need to calculate the...
April 3, 2012 at 1:30 am
Unfortunately, I wasn't able to convince my company to send me to the paid days - probably because I've worked here less than a year. Will have to catch up...
March 31, 2012 at 4:58 am
Yep, I'm here. Sat at the front waiting for Adam Machanic's talk. Should be fun 🙂
March 31, 2012 at 3:27 am
3,000 visits and you haven't learnt that the best way to get answers to your questions is to provide consumable sample data rather than a non-consumable table?
SELECT Company, Category,...
March 29, 2012 at 9:03 am
EjSQLme (3/29/2012)
Anyone with any idea on this?
If it is always no more than 4, then this will work: -
SELECT PersonID, workedcode, CONVERT(VARCHAR(10), eventdate, 101) AS Eventdate,
MAX(CASE WHEN rn = 1...
March 29, 2012 at 6:52 am
imrankhan777 (3/29/2012)
SELECT DISTINCT Store, PhoneNr,
ROW_NUMBER() OVER(PARTITION BY Store ORDER BY PhoneNr) AS Items
FROM ##testEnvironment)
SELECT Store,(SELECT PhoneNr FROM CTE AS C...
March 29, 2012 at 6:33 am
Always like to test when there are multiple ways to perform a task.
So, lets build some sample data.
IF object_id('tempdb..#testEnvironment') IS NOT NULL
BEGIN
DROP TABLE #testEnvironment;
END;
SET NOCOUNT ON;
--999,999...
March 29, 2012 at 2:20 am
Seems a bit of an over complication to me.
--Sample data
DECLARE @orders TABLE (OrderID INT IDENTITY(1,1) PRIMARY KEY, OrderAmt MONEY);
INSERT INTO @orders
SELECT OrderAmt
FROM (VALUES(45),(56.60),(75.00),(101.00))a(OrderAmt);
--Query
SELECT OrderID, OrderAmt, fee, OrderAmt + fee AS...
March 29, 2012 at 1:49 am
Viewing 15 posts - 766 through 780 (of 2,007 total)