Viewing 15 posts - 166 through 180 (of 311 total)
Hierarchyid was a new data type in SQL 2008. You posted your question in a SQL 2008 forum, so you got a SQL 2008 solution from Paul. Post your questions...
March 20, 2010 at 4:25 pm
Unfortunately we don't have a realistic testset (and I'm too lazy now to generate one), but I'm almost certain that Paul's solution outperforms my solution by a factor of 'a...
March 20, 2010 at 10:59 am
Before I follow your link to that binary tree thread, I must admit I posted a solution on counting nodes in a binary tree yesterday. I was an awkward one...
March 20, 2010 at 10:42 am
Sorry, Paul. But your solutions looks interesting. I have never used Hierarchyid before, so that leaves me something to study on.
Peter
March 20, 2010 at 10:28 am
Here's a recursive solution which allow you to vary in combination sizes easily.
DECLARE @MyTable TABLE (ID INT, Name VARCHAR(100), Kf FLOAT, Tf VARCHAR(5))
INSERT INTO @MyTable
VALUES
(1, 'TestName1', 2.5000, 'True'),
(2, 'TestName1', 2.0000,...
March 20, 2010 at 9:21 am
Well, then simply remove the group by and use an inner join to get all combinations of 4 values.
SELECT
ROW_NUMBER() OVER (ORDER BY (SELECT 0)) CombinationNo,
T1.ID, T2.ID,...
March 20, 2010 at 8:39 am
I'm not sure about your requirements, so this is just a hint. For a combination of four values you can do something like this:
DECLARE @MyTable TABLE (ID INT, Name VARCHAR(100),...
March 19, 2010 at 5:38 pm
Well, probably not very scalable but maybe this one will do:
if object_id('dbo.user_registration_tbl', 'u') is not null
drop table dbo.user_registration_tbl
create table dbo.user_registration_tbl
(
id int identity,
user_first_name varchar(100) not...
March 19, 2010 at 2:11 pm
Paul White NZ (3/19/2010)
Good idea, Peter. Sorry if I stepped on your toes there...
Not at all. And I think it was a great suggestion about upgrading a SQL2000 database...
March 19, 2010 at 9:47 am
It's because MIN(ListPrice) for ProductCategoryID 2 < 200 in the rollup row. Try something like
HAVING P.ProductSubcategoryID IS NULL OR MIN(ListPrice) > 200;
March 19, 2010 at 9:39 am
It would be nice to see the outcome of an LEFT OUTER JOIN version of the query executed by SSMS 2008. If the Owner column is NULL there is a...
March 19, 2010 at 9:29 am
An alternative is using SSIS. It contains components to work with WMI.
Peter
March 15, 2010 at 5:52 pm
If I open the Tables list in SSMS 2005 the following query is fired:
SELECT
'Server[@Name=' + quotename(CAST(serverproperty(N'Servername') AS sysname),'''') + ']' + '/Database[@Name=' + quotename(db_name(),'''') + ']' + '/Table[@Name=' + quotename(tbl.name,'''')...
March 14, 2010 at 4:26 am
You mean quoted strings? From the main menu go to Query|Query Options... and select Grid. There is an option 'Quote strings containing list separators when saving .csv results'.
Peter
March 13, 2010 at 4:20 am
I'm not sure why but you have to enlarge the numbers table to get rid of the error. After that the query runs in 82 seconds on my machine.
Num1 (n)...
March 10, 2010 at 4:56 am
Viewing 15 posts - 166 through 180 (of 311 total)