Viewing 15 posts - 7,231 through 7,245 (of 8,731 total)
In read-commited isolation level, readers don't block readers.
January 10, 2014 at 2:23 pm
mister.magoo (1/10/2014)
or this, which I personally find more "readable", but that's probably just me...
, (select max(moddate) from (values(P.ModifiedDate),(PD.ModifiedDate),(PA.ModifiedDate)) a(moddate)) AS ModifiedDate
, (select max(credate) from (values(P.CreatedDate),(PD.CreatedDate),(PA.CreatedDate)) a(credate)) AS CreatedDate
That's clever. I...
January 10, 2014 at 2:22 pm
It seems that a simple CASE statement will do the trick. Because your Modified date and Created Date columns are non-nullable on all tables, the query becomes simpler.
SELECT --DISTINCT
...
January 10, 2014 at 11:16 am
I would follow hisakimatama's recommendations on the validation of your backups.
However, to store the value returned by your restore statement, you could use dynamic code and sp_executesql to store the...
January 10, 2014 at 10:29 am
There's an easier way to do this without using variables.
SELECT 'The diff in years ' + DATEDIFF(YEAR, MIN(birthdate), MAX(birthdate))
FROM hr.employees
As Sean pointed out, you can't use a variable for your...
January 10, 2014 at 10:22 am
I have some SW essentials and some nice to have, most of them have already been mentioned.
Essentials:
SSMS
BIDS
Word processor
Spread sheet SW
Email SW
Internet access
Nice to have:
Notepad++
Chrome
Code formatter
But something that hasn't been mentioned...
January 10, 2014 at 10:06 am
To get this query, i would use nested CTEs (or subqueries) first using a RANK() function to determine which products I will include, then ROW_NUMBER() on the result to get...
January 10, 2014 at 8:52 am
Here's one solution using a cteTally. You could turn this code into an inline table-valued function to use it against a query. If you have any questions on how it...
January 10, 2014 at 8:39 am
If the intention is to simplify, here's another option.
SELECT a.invoic_no, a.item_no
,Sales= CASE WHEN item1 = a.item_no THEN a.invoic_qty ELSE 0 END
,Free=...
January 9, 2014 at 6:05 pm
Could you provide DDL, sample data and expected results in the form of insert statements? You can read on how to do it in the article linked in my signature.
January 9, 2014 at 3:26 pm
John,
It seems to be more than that as it depends on a hierarchy. This is a duplicate post and it was originally posted here.
http://www.sqlservercentral.com/Forums/Topic1529451-391-1.aspx
January 9, 2014 at 3:09 pm
I hope that it helps you. If you have any more questions, feel free to ask 😉
January 9, 2014 at 12:39 pm
You might want to review your sample data as it won't give the expected results. Root for ship and boat is air and some multiplications won't give the values you...
January 9, 2014 at 11:57 am
If see 2 options:
A. You're using a different column from Table1 (email & email1), but it could be a transcription error.
B. You have null values on email column, check this:
select...
January 9, 2014 at 10:02 am
For SSIS, the data type should be DT_DATE or DT_DBTIMESTAMP2.
If you try to convert '2011-04-26-08.02.51.036000' to a datetime2 in SQL Server, you'll get an error. A different format is needed...
January 9, 2014 at 9:35 am
Viewing 15 posts - 7,231 through 7,245 (of 8,731 total)