Viewing 15 posts - 1,651 through 1,665 (of 2,648 total)
UPDATE a
SET a.DOC2 = b.DOC2
FROM myTable a
CROSS APPLY(SELECT TOP(1) b.DOC2 FROM myTable b WHERE b.DOC = a.DOC ORDER BY b.VERSION) b
March 8, 2019 at 10:25 am
I think this is an equivalent query;WITH cte as
(
SELECT tkt.OrderHeader,a.*,sum(value) OVER (partition by tkt.orderheader,date) as Profit
FROM dbo.[OrderDetails] ...
March 8, 2019 at 7:21 am
USE Test
GO
DECLARE @p1 AS INT = 9, @p2 AS INT = 2;
SELECT CAST(@p1 AS NUMERIC(12, 2))/ CAST(@p2 AS NUMERIC(12, 2)) ReturnResult
INTO dbo.TestDivisionReturnType;
GO
EXEC sp_help 'dbo.TestDivisionReturnType'
GO
DROP TABLE dbo.TestDivisionReturnType
March 8, 2019 at 5:55 am
March 7, 2019 at 10:06 am
March 7, 2019 at 4:29 am
March 7, 2019 at 4:24 am
March 6, 2019 at 7:37 am
ChrisM@Work - Wednesday, March 6, 2019 5:28 AMToday's SSC Featured Contents includes a section on capturing live execution plans using Extended Events.
That's...
March 6, 2019 at 6:38 am
March 6, 2019 at 6:37 am
March 6, 2019 at 5:15 am
March 5, 2019 at 11:19 am
SELECT --TOP 10
t.query_sql_text,
q.query_id,
OBJECT_NAME(q.object_id) AS parent_object,
CONVERT(xml, P.query_plan),
Q.last_execution_time
FROM sys.query_store_query_text t
INNER JOIN...
March 5, 2019 at 10:42 am
Ideally you would have a primary key on your table, an identity column or somthing similar so you won't find the same row overlapping with itself:select t1.enrollid,
...
March 5, 2019 at 8:11 am
March 5, 2019 at 7:37 am
Your query looks ok, exists and not exists are fast methods of filtering.
A few of points:
I would give every table an alias and use it on every...
March 5, 2019 at 6:42 am
Viewing 15 posts - 1,651 through 1,665 (of 2,648 total)