Viewing 15 posts - 1,231 through 1,245 (of 1,468 total)
March 27, 2017 at 10:18 pm
March 27, 2017 at 3:07 pm
March 27, 2017 at 2:50 pm
--00000000
--02005523
So with the patindex is there a way...
March 27, 2017 at 7:55 am
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
Viewing 15 posts - 1,231 through 1,245 (of 1,468 total)