Viewing 15 posts - 661 through 675 (of 2,171 total)
It's doable in one step.
See here...
DECLARE@Sample TABLE
(
recID INT IDENTITY(1, 1),
col1 VARCHAR(1),
col2 VARCHAR(2),
col3 VARCHAR(3),
userID INT
)
INSERT@Sample
SELECT'A', 'B', 'C', 1 UNION ALL
SELECT'A', 'B', '', 1 UNION ALL
SELECT'A', '', 'C', 1 UNION ALL
SELECT'F', '',...
October 15, 2008 at 8:49 am
DECLARE@Sample TABLE
(
person INT,
[Type] VARCHAR(20),
id INT,
[Start_Date] DATETIME,
End_Date DATETIME,
PRIMARY KEY CLUSTERED
(
person,
[start_date],
id
),
grp int
)
INSERT@Sample
(
person,
[Type],
id,
[Start_Date],
End_Date
)
SELECT118007, 'ECAFSTD', 502858, '2007-09-10', '2007-09-10' UNION ALL
SELECT118007, 'ECAFMTG', 503341, '2007-09-10', '2007-12-11' UNION ALL
SELECT118007, 'ECAFSTD', 591228, '2008-02-05', '2008-02-05' UNION ALL
SELECT118007, 'ECAFMTG', 598235,...
October 14, 2008 at 4:30 am
INSERTNewTracks
(
AlbumID,
TrackTitle,
TrackPosition,
TrackDuration
)
SELECTProductID,
Title,
Position,
Duration
FROM(
SELECTAlbum.ProductID,
Tracks.Title,
Tracks.Position,
Tracks.duration,
ROW_NUMBER() OVER (PARTITION BY Album.ProductID ORDER BY ...) AS RecID
FROMAlbum
INNER JOINTracks ON Tracks.ProductID = Album.ProductID
) AS d
WHERERecID = 1
October 13, 2008 at 8:48 am
There you go! 🙂
I learn something new every day...
October 13, 2008 at 12:06 am
Jeff Moden (10/9/2008)
G Bryant McClellan (10/8/2008)
Michael,Ummm.... both table variables and temp tables start out in memory and "jump" to TempDB when they overcome some point in memory.
Really?
I was under the...
October 12, 2008 at 1:48 pm
Mostly with SQL Profiler and using the RowCount for 2005 and later, or integerdata for sql server 2000.
Last year I was involved in a large project for performance tuning and...
October 12, 2008 at 1:27 pm
In my experience, the table variable flushes to disk when approx two pages has been filled.
October 12, 2008 at 7:06 am
See the link posted before
http://www.sqlservercentral.com/articles/Advanced+Querying/pivottableformicrosoftsqlserver/2434/%5B/url%5D
October 11, 2008 at 4:52 am
Did you find the time to tset my suggestion, ie run the query manually vs the vendor-provided query?
Was there a time difference? Was the plan different?
I believe the query will...
October 7, 2008 at 11:28 pm
This rewrite should produce the same result
INSERT[#0ea9a6bfe6f948ce8ed5e5e1187f930c]
(
ResourceGuid
)
SELECTResourceGuid
FROMCollectionIncludeResource
WHERECollectionGuid = @collectionGuid
UNION
SELECTResourceGuid
FROMCollectionMembership AS cm
INNER JOINCollectionIncludeCollection AS cic ON cm.CollectionGuid = cic.SubCollectionGuid
WHEREcic.CollectionGuid = @collectionGuid
UNION
SELECTw.GUID
FROM#vResource AS w
INNER JOIN(
SELECT_ResourceGUID
FROMInv_AeX_AC_Client_Agent
WHERE[Agent Name] = 'Altiris...
October 6, 2008 at 7:36 am
What else do you have to uniquely identifi your importpersons?
October 6, 2008 at 7:16 am
According to sample data, this is what you need.
SELECT Col1,
Col2,
...
October 4, 2008 at 5:18 am
Will that work when records in table are stored in other order?
old
10203003275 D/C SET 0138 12/31/02 00086116 ...
October 2, 2008 at 7:46 am
something like this?
SELECTSUM(CASE WHEN Status = 'A' THEN 1 ELSE 0 END) AS countReally,
SUM(Points) AS OrdinarySum,
SUM(CASE WHEN Status = 'B' THEN Points ELSE 0 END) AS casedSum
FROMTable
October 2, 2008 at 7:16 am
SELECTCol1,
Col2,
Col3
FROMTable1
WHERECol3 > ''
SELECTCol1,
Col2,
Col3
FROMTable1
WHERECol2 LIKE 'D/C SET%'
Maybe if you post sample data like previous post we can help you more.
October 2, 2008 at 2:59 am
Viewing 15 posts - 661 through 675 (of 2,171 total)