Viewing 15 posts - 46 through 60 (of 78 total)
I’ve added the option within the function itself and it’s working now. Everything I read online said I could not do that ??
sometimes You just have to try things...
June 11, 2021 at 3:17 am
You tried to add it in the middle of your SQL Statement. Do it after the order by clause
Use sand
Drop table if exists #testfunction;
Select b.*
into #testfunction
From (...
June 10, 2021 at 8:14 am
You can use the option (maxrecursion 0) at the SQL statement that uses your table valued function. Here is an example:
CREATE or alter FUNCTION Demo
(
...
June 10, 2021 at 7:53 am
You need to check if the latches are on GAM, SGAM and PFS pages. If the contention is on those pages, then adding more files might help you. If the...
June 9, 2021 at 6:35 am
Are you sure that you are getting the same record as before? Is there a chance that you have something like select top 1 that today didn't get to the...
June 8, 2021 at 1:15 pm
You you can use the row_number() window function to generate the number. Here is an example:
create table test
(
FamilyId int,
PortionKey nvarchar(20),
GroupId int,
GeneratedNumber int
)
insert into test(FamilyId,PortionKey,GroupId,GeneratedNumber)
values
(12100,'ab',1,NULL),
(12100,'cd',2,NULL),
(12100,'eg',3,NULL),
(12100,'fb',4,NULL),
(12100,'am',1,NULL),
(12100,'fu',2,NULL),
(12100,'ab',3,NULL),
(12100,'cy',4,NULL),
(12100,'lf',1,NULL),
(12100,'ad',2,NULL),
(12100,'gb',3,NULL),
(12100,'mu',4,NULL)
go
with MyCTE as (
select...
June 7, 2021 at 8:24 am
You can use the IIF function - IIF(Person.Termination_Date IS NOT NULL, 'N', 'WhatEverYouWantInCaseOfNullHere')
Adi
June 7, 2021 at 7:56 am
Pending recovery means that for some reason recovery did not start and the SQL server is waiting for something to happen. Most times when it happened to me, it was...
May 31, 2021 at 12:56 pm
Have to admit that I don't think that this is a simple text manipulation, because it could get very messy. Depending on how many "conventions" were used in the code,...
May 20, 2021 at 2:00 pm
Modifying all the code to point to a new schema is a very hard task. Depending on the amount and complexity of your code, it might be a task that...
May 20, 2021 at 6:30 am
Most times that I've seen a dramatic improvement in performance after index rebuild it was due to the fact that statistics were also updated and the query plan was modified. ...
May 13, 2021 at 6:21 am
You can use the except operator. Here is an example that is based on your script
CREATE TABLE PEOPLE (
[PEOPLEID] [bigint] IDENTITY(10000,1) NOT NULL,
[NAME] varchar(250) NOT NULL);
CREATE TABLE...
May 12, 2021 at 8:05 am
I think that searching just for the first occurrence of the letter T is not good, because you can also have a file that has the letter T in it's...
May 12, 2021 at 7:49 am
It has been a while since I worked with AG, but from what I remember if you specify the listener name in the connection string and you don't use read...
May 11, 2021 at 9:17 am
DECLARE @Employees TABLE
(
ID smallint PRIMARY KEY,
FirstName varchar(30) NOT NULL,
LastName varchar(30) NOT NULL,
Status varchar(10),
Pay decimal(10,2),
JobType varchar(30) NULL
)
INSERT @Employees VALUES (1,'Jeff','Bagwell', 'Active', 250.75, 'Manager')
INSERT @Employees VALUES (2,'Jose','Lima', 'Active', 175.50,...
May 11, 2021 at 8:46 am
Viewing 15 posts - 46 through 60 (of 78 total)