Viewing 15 posts - 1,246 through 1,260 (of 1,464 total)
WITH ctePerson AS (
SELECT *
, nextVisitDate = LEAD(p.VisitDate, 1, '2199-12-31') OVER (PARTITION BY PID ORDER BY p.VisitDate)
FROM #person AS p
March 9, 2017 at 8:14 am
Is there a reason why the CLUSTERED key is on the IDENTITY field?
Based purely on this query, you could look at changing the PRIMARY KEY to a NON-CLUSTERED...
March 9, 2017 at 3:48 am
You can try something like this. NOTE: The lack of data or expected results means that this code is untested.WITH cteDateCalc AS (
SELECT
trackid
March 7, 2017 at 11:17 pm
Since this is a SQL 2008 Forum, I assume that you are using SQL 2008. In this case a SEQUENCE object will not work.
You could use a watermark...
March 6, 2017 at 11:24 pm
Your first problem is that you have tag names that include mathematical operators. How do you know whether SC-1 is "SC" minus 1, or just the tag "SC-1".
Once...
March 2, 2017 at 5:53 am
March 2, 2017 at 1:20 am
I used the following code, and get 4 results from the sample XML that you posted.
DECLARE @CAQH_Return_XML TABLE (FileInfo XML);
INSERT INTO @CAQH_Return_XML(FileInfo)
VALUES...
March 1, 2017 at 12:46 am
Your solution works brilliantly, thank you so much! Sorry...
February 24, 2017 at 5:10 pm
Please post readily usable code. A picture of the xml doesn't help. I have added the Provider root, as well as the NPI and LastName nodes to your sample data.
February 23, 2017 at 3:09 pm
February 17, 2017 at 1:45 am
2 Possible options ...
DECLARE @SeedVal INT = ISNULL((SELECT LID_ID_NB from LastIDNumber WHERE LID_KET_NM = 'TableName'), 0) +1;
DBCC CHECKIDENT ( TableName, RESEED, @SeedVal ) WITH...
February 14, 2017 at 10:55 am
I'm still getting a listing of each hour of that day and not the...
February 10, 2017 at 12:47 pm
SELECT TOP(1) ID
FROM YourTable
ORDER BY StartDate DESC;
February 9, 2017 at 4:41 am
briancampbellmcad - Friday, February 3, 2017 7:06 AM
If the fields in this screenshot are declared as NVARCHAR, it shows...
February 6, 2017 at 1:03 pm
February 6, 2017 at 12:44 pm
Viewing 15 posts - 1,246 through 1,260 (of 1,464 total)