Viewing 15 posts - 211 through 225 (of 445 total)
Looking at plan i see only 3 tables behind the views. Seems like kind of EAV database design.
Probably optimizer is totally lost on proper cardinality estimations when decoding views...
April 2, 2015 at 4:04 am
waxingsatirical (4/2/2015)
This post explores one of the performance pitfalls you can get yourself into by introducing DRY principles with SQL server.http://cubicmile.co.uk/2013/06/02/sql-code-re-use-a-worked-example/
Using TVF is another story. CROSS APPLY with row-scope...
April 2, 2015 at 3:01 am
Plain Goup By
CREATE TABLE #Orders (ID INT IDENTITY(1,1),OrderID INT,ProjectId INT,ProductID INT,ProjectAmt DECIMAL(10,2),ProductAmt DECIMAL(10,2));
INSERT INTO #Orders
(
...
April 1, 2015 at 8:12 am
If as originally was stated you need preceeding months (jan, feb, march) for april, april not included, then a minor tweak is needed
LEFT JOIN
ON ... >=
...
March 31, 2015 at 8:21 am
Try
select name
from admins
where group in ('TJA','tJB','tJK','tnr')
group by name
having count( distinct group)=4
March 31, 2015 at 8:00 am
Also you can use xp_dirtree SP to get a table of files and dirs in the target physical location.
Note the path should be specified for your MSSS ...
March 31, 2015 at 7:52 am
karthik82.vk (3/23/2015)
I tried changing the length of @tbl_style variable from 1024 to 2000. However i am getting the same error. The @tbl_style variable has to do nothing with...
March 24, 2015 at 1:07 am
Although both queries below compute the same result set i see no reason why to go this way. 'Traditional' GROUP BY performs by far better.
select distinct [SalesOrderID], s...
March 23, 2015 at 8:01 am
Most probably proc parameter @TBL_STYLE NVARCHAR(1024) is the problem.
When concatenating two NVARCHAR(n) strings, where n is not MAX, the length of the result can not exceed 4000. Intermediate result is...
March 23, 2015 at 6:32 am
mbSanDiego (3/21/2015)
SELECT c.CarId, c.CarName, c.CarColor, COUNT(t.TrailerId)...
March 23, 2015 at 2:26 am
Undocumented sp_MSforeachtable may process only tables needed
EXEC sp_MSforeachtable
@command1='select ''?'', count(ID) from ?',
@whereand='AND o.id in (select object_id from sys.columns c where c.name=''ID'')'
March 20, 2015 at 4:12 am
govind.sharma1 (3/20/2015)
select @Xml_prod= cast(c1 as xml) from OPENROWSET (BULK 'C:\xmldownload\adzunajobfeeds.xml',SINGLE_BLOB) as T1(c1)
Msg 6365, Level 16, State 1, Line 1 An XML operation resulted an XML data type exceeding...
March 20, 2015 at 3:33 am
siggemannen (3/19/2015)
HASHBYTES will give different results for following two xmls:
<xml>
<attribute1>1/<attribute1>
<attribute2>2/<attribute2>
</xml>
<xml>
<attribute2>2/<attribute2>
...
March 19, 2015 at 7:43 am
Use a compare xml tool, for example http://www.altova.com/diffdog/xml-diff.html
March 19, 2015 at 5:43 am
Viewing 15 posts - 211 through 225 (of 445 total)