Viewing 15 posts - 5,761 through 5,775 (of 10,143 total)
Eugene Elutin (8/31/2012)
dwain.c (8/31/2012)
Eugene Elutin (8/31/2012)
draw Mona Lisa using T-SQL (I remember I had seen assembler application which would print out...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 31, 2012 at 6:52 am
Eugene Elutin (8/31/2012)
...draw Mona Lisa using T-SQL...
Okay.
SELECT *
FROM (
SELECT '......................' UNION ALL
SELECT '......................' UNION ALL
SELECT '......########........' UNION ALL
SELECT '.....##...#.###.......' UNION ALL
SELECT '.....#..#...###.......' UNION ALL
SELECT '.....#..##..###.......' UNION...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 31, 2012 at 6:15 am
renvilo (8/31/2012)
...So in short, how do I count how many shift there was from breaking time to fixing time with my #Final temp table and my Shifts table?...
Start by setting...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 31, 2012 at 5:58 am
denis.gendera (8/31/2012)
select machine_id, MONTHS =
CASE
WHEN DATEDIFF("m", firstseen, getdate()) = 0 then 'AUG'
...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 31, 2012 at 5:43 am
Here's another way:
;WITH Locations AS (
SELECT
DATEADD(dd, 0, DATEDIFF(dd, 0, createdate)) AS createdate,
COUNT(DATEADD(dd, 0, DATEDIFF(dd, 0, createdate))) AS totalcount,
sum(case channel when 'website' then 1 else 0 end) as WebsiteViews,
sum(case channel...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 31, 2012 at 4:10 am
You will need to set up some sample data for this, there's a link in my sig to a great article which shows you how it's done.
Without knowing how...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 31, 2012 at 3:43 am
You don't appear to need dynamic sql for this:
SELECT
--app.id,
edit.project_name
FROM tracker app
INNER JOIN edit edit
ON app.id=edit.id
WHERE edit.project_name LIKE ('%' + REPLACE(@project_name,'*','%') + '%')
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 31, 2012 at 3:14 am
sivajii (8/31/2012)
[1|cricket, 1| bowling&fielding, 2| batting] [2|football, 4| foul]
but the out put should be like...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 31, 2012 at 2:42 am
fredriksv80 (8/31/2012)
...I have an index on col. Is it bad to update a column used in the where clues?...
No, the entire set of rows matching the search predicates are identified...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 31, 2012 at 2:08 am
Check the collation of the target column - it may be different from the database default.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 30, 2012 at 9:44 am
RBarryYoung (8/30/2012)
Geez, I go to bed, get up, and there's twenty new posts!...
Have you checked the date today Barry? 😛
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 30, 2012 at 9:15 am
RBarryYoung (8/30/2012)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 30, 2012 at 9:09 am
dwain.c (8/30/2012)
ChrisM@Work (8/30/2012)
SELECTm.[Definition],
d.TABLE_NAME
FROM sys.sql_modules m
OUTER APPLY (
SELECT TABLE_NAME
FROM YourDatabase.INFORMATION_SCHEMA.TABLES t
WHERE m.definition LIKE '%'+t.TABLE_NAME+'%'
GROUP BY TABLE_NAME
) d
Edit: changed db name
A man of few words! I...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 30, 2012 at 8:15 am
SELECT
m.[Definition],
d.TABLE_NAME
FROM sys.sql_modules m
OUTER APPLY (
SELECT TABLE_NAME
FROM YourDatabase.INFORMATION_SCHEMA.TABLES t
WHERE m.definition LIKE '%'+t.TABLE_NAME+'%'
GROUP BY TABLE_NAME
) d
Edit: changed db name
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 30, 2012 at 7:47 am
dwain.c (8/30/2012)
SQLHeap (8/30/2012)
Pretty clever dwain, thanks for your input!
Hey! Almost missed your thanks there! 😛 You're very welcome.
And don't listen to ChrisM@Work - he's just a grumpy...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 30, 2012 at 6:43 am
Viewing 15 posts - 5,761 through 5,775 (of 10,143 total)