Viewing 15 posts - 24,481 through 24,495 (of 59,099 total)
dhananjay.nagarkar (2/4/2014)
I'm trying to do-If the "[Latest Filled Date]" equals the previous weeks Monday - Saturday dates...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 4, 2014 at 10:02 pm
For those that still work in 2005 that would like to play with such a thing, I've reworked the sample data to work in 2005 and up. This will...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 4, 2014 at 9:11 pm
Luis Cazares (2/4/2014)
SELECT
SUM(CASE qtr WHEN 1 THEN sales END) AS q1,
SUM(CASE qtr WHEN 2 THEN sales END) AS...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 4, 2014 at 8:48 pm
p.avinash689 (2/4/2014)
I'm using Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (Intel X86) Apr 2 2010 15:53:02 Copyright (c) Microsoft Corporation Developer...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 4, 2014 at 5:01 pm
Correct on all counts. The last bit of code you posted would be correct to make the query SARGable.
--Jeff Moden
Change is inevitable... Change for the better is not.
February 4, 2014 at 4:37 pm
Ahhh.... I found the problem. It has to do with which trace file is selected and I've got it working on my prod server. I'm redacting the code...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 4, 2014 at 8:28 am
SQLRNNR (2/3/2014)
--Jeff Moden
Change is inevitable... Change for the better is not.
February 4, 2014 at 7:31 am
RexHelios (2/3/2014)
CREATE TABLE dbo.Employee (
EmployeeIDINTNOT NULL,
EmpFirstNameVARCHAR (50)NOT NULL,
EmpMiddleNameVARCHAR (50)NOT NULL,
EmpLastNameVARCHAR (50)NOT NULL,
EmpDOBDATETIMENOT NULL,
EmpSSNVARCHAR(11)NULL,
DateCreatedDateTimeNOT NULL,
DateModifiedDateTimeNOT NULL
)
I also have an audit table to keep track of changes made...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 3, 2014 at 8:45 pm
For such a small table as the given Employee table, I agree. If not CDC, then use full row auditing instead.
However, for very wide tables, this method is...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 3, 2014 at 5:39 pm
Grant Fritchey (2/3/2014)
--Jeff Moden
Change is inevitable... Change for the better is not.
February 3, 2014 at 5:16 pm
L' Eomot Inversé (2/3/2014)
Oh, if only the reasonably competent used it it would be great
BWAA-HAAA!!!! Absolutely agreed. I said the very same thing when SQLCLR, the XML datatype,...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 3, 2014 at 2:03 pm
To add to that, unless you only have a 100 customers or so, I think it a bit insane to return all customers at any time.
--Jeff Moden
Change is inevitable... Change for the better is not.
February 3, 2014 at 12:06 pm
elham_azizi_62 (2/3/2014)
select * from dbo.Split('1234567890,2,''92/11/14'',''92/11/17'',''92/11/14'',9214,''92/11/14'',''92/11/14'',1,4,''????? 2''' ,',')
now I need to use from function result for sp parameter:
Exec mysp a,b,c,d,e,f,g,h,i,j,k
I need to this:a=1234567890
b=2
c='92/11/14' and ....
how do i...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 3, 2014 at 12:02 pm
My recommendation would be to NOT use numerics here. M, F, U, etc adds clarity and avoids confusion. If you really want to do it right, lookup the...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 3, 2014 at 10:25 am
Grant Fritchey (2/3/2014)
Sean Lange (1/31/2014)
wolfkillj (1/31/2014)
Ed Wagner (1/31/2014)
Luis Cazares (1/30/2014)
Would this help?http://www.sqlskills.com/blogs/kimberly/guids-as-primary-keys-andor-the-clustering-key/
http://blogs.msdn.com/b/sqlserverfaq/archive/2010/05/27/guid-vs-int-debate.aspx
Maybe even a post from a GUID lover:
http://blogs.msdn.com/b/sqlazure/archive/2010/05/05/10007304.aspx
Or even BOL on Using uniqueidentifier Data:
http://technet.microsoft.com/en-us/library/ms190215(v=sql.105).aspx
I especially like Kimberly's article Luis...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 3, 2014 at 8:25 am
Viewing 15 posts - 24,481 through 24,495 (of 59,099 total)