Viewing 15 posts - 1,231 through 1,245 (of 1,464 total)
Well, the documentation states that these new columns were added from SQL 2016. However, they are available in my SQL 2014 instance.
SELECT @@VERSION;
March 26, 2017 at 10:22 pm
March 23, 2017 at 9:55 pm
You could achieve this with a MERGE statement.
There is no need for an explicit transaction, as it is one one statement that will succeed or rollback as a whole.
March 23, 2017 at 2:09 pm
March 23, 2017 at 12:29 pm
The query works.
What is your expected outcome?
March 21, 2017 at 5:40 am
The format of your query appears to ba MySQL format.
In T-SQL, we can do it like this ...
Create some sample data
CREATE TABLE...
March 21, 2017 at 3:15 am
Please provide us with CREATE TABLE scripts for the 2 tables, as well as INSERT statements with sample data, and the expected results.
March 21, 2017 at 2:59 am
Although off topic, in SQL 2008 the query optomiser always assumes 1 record in @staging_table_var. This is because SQL does not maintain stats for @Table variables.
If you change to...
March 20, 2017 at 6:58 am
You could try to get the Primary number first ...
WITH ctePhoneNumber AS (
SELECT
pn.PersonID,
pn.PhoneNumber,
rn =...
March 20, 2017 at 12:33 am
Firstly, start off by using Jeff Moden's Tally function
CREATE FUNCTION [dbo].[fnTally]
/**********************************************************************************************************************
Purpose:
Return a column of BIGINTs from @ZeroOrOne up to and including...
March 18, 2017 at 1:00 am
You can also provide a Default value for the LEAD/LAG Window functions.
In this case, it means not having to add the extra AND PREVIOUS_CODE IS NOT NULL in the...
March 17, 2017 at 4:21 am
Yes, there s a single open tran for the full duration of the looping and deleting.
Since there is no where clause ... why would he not simply do a...
March 15, 2017 at 11:42 am
The following code will work, so long as you only have 5 days per VM.
WITH cteDayNum AS (
SELECT *
, [DayNum] =...
March 13, 2017 at 1:54 pm
SELECT
ID
, DateDifference = SUM(DATEDIFF(DAY, ReportedDate, CompletedDate))
FROM #ReportTable
GROUP BY ID;
March 12, 2017 at 11:38 pm
SELECT DISTINCT
t.EmpId AS Id,
t.STDID
INTO #Temp
FROM dbo.Employee t
SELECT DISTINCT
t.EmpAuditId AS Id,
t.STDID
INTO #Temp2
FROM...
March 10, 2017 at 7:10 am
Viewing 15 posts - 1,231 through 1,245 (of 1,464 total)