Viewing 15 posts - 3,721 through 3,735 (of 10,144 total)
IgorMi, you can use http://extras.sqlservercentral.com/prettifier/prettifier.aspx.
I tend not to. If I'm about to spend a few minutes reading and understanding a chunk of code, reformatting it easily becomes part of the...
January 24, 2014 at 4:00 am
phineas629 (1/24/2014)
... I am required to use the cursor...
Perfectly reasonable so long as this is homework. If not, then do it properly:
UPDATE Outlet.tblProductMaster SET
Product_Status = CASE
WHEN Seller_No = @strSellerNo1...
January 24, 2014 at 3:08 am
If you're wondering what the variables are for in the UPDATE, they collect some column values as they are before any updates have been performed:
DROP TABLE #EXPORTMAIN
CREATE TABLE #EXPORTMAIN (
ID...
January 24, 2014 at 2:41 am
Same statement rewritten as UPDATE FROM, with nonsense logic commented out:
-- Formatted
DECLARE @tempS AS nvarchar(150)
DECLARE @tempW AS nvarchar(50)
DECLARE @tempQ As nvarchar(5)
UPDATE e SET
@tempS = SKU1, --...
January 24, 2014 at 2:35 am
Formatted for readability:
-- Formatted
DECLARE @tempS AS nvarchar(150)
DECLARE @tempW AS nvarchar(50)
DECLARE @tempQ As nvarchar(5)
UPDATE dbo.EXPORTMAIN SET
@tempS = SKU1,
@tempW = WHSELOC1,
@tempQ = QTY1,
SKU1 = Case
When...
January 24, 2014 at 1:59 am
lianvh 89542 (1/23/2014)
January 23, 2014 at 3:56 am
lianvh 89542 (1/23/2014)
January 23, 2014 at 2:20 am
Prassad Dabbada V R (1/21/2014)
Write CTEcheck below link for example on CTE
http://www.codeproject.com/Articles/265371/Common-Table-Expressions-CTE-in-SQL-SERVER-2008
The examples are fine but the author of the article clearly knows little about CTE's and slips on a...
January 22, 2014 at 7:19 am
Before considering esoteric wait stats and such, your code would benefit from an overhaul to bring your join syntax up to date. Your first query equates to this:
UPDATE pro SET...
January 22, 2014 at 6:41 am
kbhanu15 (1/22/2014)
i think it wont work in views?
view details:
create view Screen_RatingsData_ProbabilityOfDefault_vw
as
select...
January 22, 2014 at 4:34 am
kbhanu15 (1/22/2014)
the below query taking 5 minutes time, i want to rewrite this query ?
query details :
select pd.companyId, asOfDate as scoreDate, Convert(numeric(38,10),pd.PDValue) * 100 as zscore
from pdDataMarketSignal_vw...
January 22, 2014 at 3:07 am
Like Gail, I don't think this expression is going to have much impact on performance. Maintainability is another story - updating n queries to account for product changes leaves you...
January 22, 2014 at 1:56 am
mickyT (1/21/2014)
ChrisM@Work (1/21/2014)
Couple of small changes to MickeyT's otherwise excellent function:
Thanks Chris, I missed that I had messed up the result. I made some changes for performance to what...
January 22, 2014 at 1:36 am
Ford Fairlane (1/19/2014)
Thanks for the heads up Jeff, how would you tackle it then ?
Start by reducing the noise to see what's going on:
SELECT
x.YearMonth,
[DEPTH] = (
SELECT
SUM(b.DEPTH)
FROM HOLELOCATION b
CROSS...
January 21, 2014 at 7:19 am
abhas (1/21/2014)
Thanks All,
I am doing the same.
SELECT
ROW_NUMBER() OVER (PARTITION BY t.CustomerName ORDER BY t.DateAdded DESC) AS RowNumber
from tblCustomer. but it is giving 1,2,3.....RowNumber.
I want again repeat RowNumber to each...
January 21, 2014 at 6:48 am
Viewing 15 posts - 3,721 through 3,735 (of 10,144 total)