Viewing 15 posts - 4,846 through 4,860 (of 10,143 total)
mamzy.rahman (4/11/2013)
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
April 11, 2013 at 4:24 am
In the little query I wrote above, change #Sample to aims.
Just this query, not the sample data generator:
-- solution
SELECT COUNT(L01)
FROM #Sample s
WHERE NOT EXISTS (
SELECT 1
FROM #Sample si
WHERE...
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
April 11, 2013 at 4:14 am
mamzy.rahman (4/11/2013)
i cant create just query 🙁
What is the name of the table you are using?
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
April 11, 2013 at 4:08 am
mamzy.rahman (4/11/2013)
hi thanks for your efforts but i cannot drop the tables is there a way of doing it without altering any of the tables
-- create some sample data to...
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
April 11, 2013 at 4:05 am
-- create some sample data to test against
DROP TABLE #Sample
CREATE TABLE #Sample (L01 INT, a09 CHAR(1))
INSERT INTO #Sample (L01, a09)
SELECT 123, '1' UNION ALL
SELECT 123, '2' UNION ALL
SELECT 123, 'z'...
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
April 11, 2013 at 3:58 am
-- Here's the last change.
USE [Build1]
SELECT
td.TYPE_NAME
,i.DOC_NAME
,i.DOC
,i.SEC
,i.VER
,r.JUSTIFICATION
FROM TBL_INSTANCES i
INNER JOIN TBL_TYPE_DEF td
ON i.TYPE_ID = td.TYPE_ID
LEFT JOIN TBL_RELATIONSHIPS r
ON i.DOC = r.PARENT_DOC
AND i.SEC = r.PARENT_SEC
AND i.VER =...
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
April 11, 2013 at 3:28 am
Thanks to Lynn & Sean for the formatted query:
-- code rewrites are iterative in nature. You make a change or two,
-- test thoroughly, amend if necessary, then make another change.
--...
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
April 11, 2013 at 3:16 am
Kurtman (4/10/2013)
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
April 11, 2013 at 1:17 am
T.Ashish (4/10/2013)
It comes from Java Code, like ......where Site_id = :lablesiteid....
-- Query 2
SELECT
TOP 100 comp_id,
sup_code,
sup_name,
sup_ac_code,(
...
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
April 11, 2013 at 1:07 am
adonetok (4/10/2013)
In ServerA, there is a query like below.
select * from [ServerB].order.dbo.allorder where city='london'
Question:
Which server will process data?
1) processing...
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
April 10, 2013 at 9:31 am
T.Ashish (4/10/2013)
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
April 10, 2013 at 9:30 am
Same as any other index:
SELECT DB_NAME(database_id) AS [Database Name], OBJECT_NAME(ps.OBJECT_ID) AS [Object Name],
i.name AS [Index Name], ps.index_id, index_type_desc,
avg_fragmentation_in_percent, fragment_count, page_count
FROM sys.dm_db_index_physical_stats(DB_ID(),NULL, NULL, NULL ,N'LIMITED') AS ps
INNER JOIN sys.indexes...
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
April 10, 2013 at 8:20 am
Krasavita (4/10/2013)
Yes,this is just for tables,what about any changes on database?
Default trace[/url] could provide most of what you're looking for.
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
April 10, 2013 at 7:49 am
sqldba_newbie (4/10/2013)
ChrisM@Work (4/10/2013)
sqldba_newbie (4/9/2013)
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
April 10, 2013 at 6:55 am
FollowingSaturday = DATEADD(day,6-DATEDIFF(day,6,Today)%7,Today)
-- example
;WITH ATableOfDates AS (
SELECT TOP(300)
Today = DATEADD(DAY,ROW_NUMBER() OVER(ORDER BY (SELECT NULL))-150,CAST(GETDATE() AS DATE))
FROM sys.columns
)
SELECT
Today,
[DayOfWeek] = DATENAME(weekday,Today),
FollowingSaturday = DATEADD(day,6-DATEDIFF(day,6,Today)%7,Today)
FROM ATableOfDates
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
April 10, 2013 at 6:05 am
Viewing 15 posts - 4,846 through 4,860 (of 10,143 total)