Viewing 15 posts - 38,686 through 38,700 (of 59,098 total)
Using the great start that Paul provided, the following will also drop the decimal point if a whole number is realized...
USE tempdb;
GO
-- *Inline* table-Itemd function
-- Deterministic, system verified, not precise
GO
CREATE...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 30, 2010 at 10:05 pm
ColdCoffee (4/29/2010)
There is absolutely no information about the emp...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 30, 2010 at 9:26 pm
Homework, Test, or Interview?
--Jeff Moden
Change is inevitable... Change for the better is not.
April 30, 2010 at 9:24 pm
Paul,
Try this...
-- Test with table
DECLARE @data
TABLE (
value DOUBLE PRECISION NULL
);
...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 30, 2010 at 8:53 pm
irobertson (4/30/2010)
Ha really? Lol, that won't work then will it? Complex function it is then.
Do you know what the maximum number of decimal places will ever be for this data?
--Jeff Moden
Change is inevitable... Change for the better is not.
April 30, 2010 at 8:30 pm
The two articles that Lutz points out above will show you how to do the "multi-pivot" you seek... and all the reasons not to use it as well as an...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 30, 2010 at 8:01 pm
Change this...
Declare @SqlStr varchar(max);
... to this...
Declare @SqlStr Nvarchar(max);
... and try again.
--Jeff Moden
Change is inevitable... Change for the better is not.
April 30, 2010 at 7:53 pm
Credits to Navy beans says there's probably a DISTINCT in the offending query and that, behind the scenes, SQL Server is having to make a whole lot more rows due...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 30, 2010 at 7:46 pm
csillag.yitzik (4/29/2010)
When I get...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 30, 2010 at 7:36 pm
p.s. Nice post, Digs. It's always great to see the table and some data.
--Jeff Moden
Change is inevitable... Change for the better is not.
April 30, 2010 at 7:05 pm
I'd recommend NOT using a clustered index that has Symbol,Date as the columns and in that order... there will be a pot wad of page splits.
Make Symbol,Date a NON clustered...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 30, 2010 at 7:04 pm
Cnu2010 (4/30/2010)
SELECT DISTINCT CITY FROM DEMO WHERE COUNTY = @COUNTY
CITY
-----
EDINA
BLOOMINGTON
EDEN PRAIRIE
SHAKOPEE
How do I display this data in a row...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 30, 2010 at 7:00 pm
Ninja's_RGR'us (4/30/2010)
How the heck will that work with a country like USA or Canada where you have 1000s of cities?
Heh... one can only hope that the criteria presented is "example...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 30, 2010 at 6:59 pm
GregoryF (4/30/2010)
Fetch each county into it.
Create a variable and keep concat'ing the new county + a space
When the cursor is done, print the variable that contains the string...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 30, 2010 at 6:57 pm
David Webb-200187 (4/30/2010)
--Jeff Moden
Change is inevitable... Change for the better is not.
April 30, 2010 at 6:55 pm
Viewing 15 posts - 38,686 through 38,700 (of 59,098 total)