Viewing 15 posts - 256 through 270 (of 670 total)
You can use the Lead function to get it
Drop table if exists #t
go
Create table #T (
RowNum int
,Id int
,IndividualId...
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 9, 2018 at 7:28 am
Here's a recursive CTE that returns the values you want. Seems you wants the contiguous keys and ignore all the noise in between
Drop...
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 6, 2018 at 10:01 am
Does this work for you?
drop table if exists #Temp
Create table #Temp(
LoanNumber varchar(10),
Inspectiondate varchar(10)
,Marketvalue float
);
Insert into #Temp values (12345,'2017-05-19',975000.00)
Insert...
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 5, 2018 at 2:09 pm
Can you provide some data and DDL for the tables?
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 5, 2018 at 12:01 pm
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 5, 2018 at 11:57 am
Looks like a corrupt index, similar to this https://www.sqlservercentral.com/Forums/Topic1401804-2893-1.aspx
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 5, 2018 at 8:10 am
I hope this isn't a homework project, otherwise, I'd have to ask What are they teaching them, deprecated syntax?
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 5, 2018 at 7:27 am
SQL introduced Try_Cast in 2012. Leaves out any hard coding
select input,
Case when try_cast(input as Date) is null
then case when try_cast(input as int)...
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 5, 2018 at 7:04 am
Why would you constantly be polling? Why not setup a job to run once an hour or 2 to look for these conditions? Then modify the payment process to update...
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 5, 2018 at 6:46 am
Try a dynamic pivot
Drop table if Exists #T
Create table #T(itemID varchar(20),
Description varchar(100),
Title varchar(20),
IndexID smallint,
...
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 3, 2018 at 12:17 pm
Sounds like a left join and Case when will do the trick. Without any real data and expected results, it's hard to give you an answer.
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 3, 2018 at 6:50 am
I think you might be getting confused with more than 1 parameter. If you Declare @TicketNo bigint...
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
June 20, 2018 at 1:24 pm
UPDATE PostsFor better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
February 8, 2018 at 3:28 pm
did my change not work for you?
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
January 30, 2018 at 2:16 pm
Try changing varchar(8000) to varchar(max). Worked for me
USE msdb;
GO
DECLARE @SourceSchema SYSNAME = 'dbo',
@SourceTable SYSNAME = 'backupset',
@TargetDatabase SYSNAME =...
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
January 30, 2018 at 12:58 pm
Viewing 15 posts - 256 through 270 (of 670 total)