Viewing 15 posts - 41,581 through 41,595 (of 59,098 total)
zukko (10/8/2009)
SELECT * FROM (
select acct_code, part_no,location,description,sku_no,list_status
,pub_date,pub_status,succession_status,void,in_stock,avg_cost
,std_cost
,((avg_cost - std_cost)/avg_cost)*100 as unit_cost_var
,(avg_cost - std_cost)*in_stock as extended_diff
,in_stock*avg_cost as extended_avg_cost
from dfi_inv_master_list ...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2009 at 5:45 pm
VERY cool! Thanks Mark.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2009 at 4:05 pm
PS... don't forget to set the recovery mode to BULK LOGGED.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2009 at 4:02 pm
USE SourceDB
SELECT CAST(columnname1 as NVARCHAR(whatever)) AS columnname1,
CAST(columnname2 as NVARCHAR(whatever)) AS columnname2,
...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2009 at 4:00 pm
Mark Marinovic (10/8/2009)
SELECT [CWS Division],
[Zone],
...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2009 at 3:29 pm
Compensation
Compensation will be $50,000 - $65,000 based on expertise and experience.
Heh... so despite the laundry list of required expertise and "nice to haves", you really want an entry level programmer....
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2009 at 3:25 pm
It is a nice hint. I wonder if Profiler will actually pick it up.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2009 at 3:20 pm
Look at the code... look at the GROUP BY... it's grouping a sum from one table by the data in 3 other tables. It's skipping the power you built...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2009 at 3:13 pm
Please read the following article on "Tally" tables... it explains how to do it for a whole table like that and it also explains why it works.
http://www.sqlservercentral.com/articles/T-SQL/62867/
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2009 at 2:22 pm
Ah... got it. If you type the code in between the code markers, you get the & gt ; character representation. If you paste between the code markers...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2009 at 1:07 pm
Testing Gails Problem...
SELECT 1 WHERE A > B
SELECT 1 WHERE A > B
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2009 at 1:06 pm
GilaMonster (10/8/2009)
Using an inequality character
SELECT session_id FROM sys.dm_exec_requests WHERE session_id > 50
Using escape codes for inequality
SELECT session_id FROM sys.dm_exec_requests WHERE session_id > 50
Using angle brackets to designate a placeholder
USE <Database...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2009 at 1:04 pm
And, to answer your question, "YES"... it's because you are now sorting on an indexed column which contains the answer to the math calculation instead of sorting on a math...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2009 at 11:11 am
Mike McQueen (10/8/2009)
I see what you're saying about the sorting after the math is done and not just sorting the...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2009 at 11:10 am
If you really want to have some fun, here's a great way to optimize the example queries that Mark wrote... I'll let you find the changes I made because it's...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2009 at 11:02 am
Viewing 15 posts - 41,581 through 41,595 (of 59,098 total)