Viewing 15 posts - 256 through 270 (of 1,464 total)
First, you want to be using the new join format
FROM @sampledata1 AS A1
CROSS JOIN @test2 ...
March 12, 2021 at 5:46 am
Your issue is that you are using a variable inside the dynamic SQL that is declared outside the dynamic SQL. For this you will need to use sp_executesql
This change...
March 10, 2021 at 7:27 am
Can THIS USER please be nuked. Every 1 of his posts has been spam.
March 8, 2021 at 7:27 am
This should do the trick
/* First get all of the records from Table1, and the Table2 values if they exist */
SELECT T1.PhoneNbr, T1.Interval, T1.CountA,...
March 5, 2021 at 6:50 am
I have no idea about performance differences. Although I cannot imagine that there will be a difference, as they are the same product installed from the same media. In our...
February 25, 2021 at 11:43 am
Firstly, you need to correctly handle the NULL returned by MAX if the table is empty.
Secondly, take a look at this article on concurrency by Gail Shaw.
You will probably...
February 25, 2021 at 10:04 am
If I am not mistaken, the order of the columns in the recommended index is based on the order that they exist in the table.
SELECT ...
February 25, 2021 at 9:58 am
Developer edition is free to download, and has all the bells and whistles of all the versions, so that you can develop the features you require. HOWEVER, you cannot use...
February 25, 2021 at 8:33 am
It's not 100% clear what you are trying to achieve.
Maybe this will get you on the right path
DECLARE @TestData table (StringVal varchar(10));
INSERT INTO @TestData ( StringVal )
VALUES...
February 23, 2021 at 7:45 am
Those values do not represent time.
So, guessing what they are supposed to represent, you have to first convert them to a format that SQL can interpret as time, then do...
February 22, 2021 at 3:18 pm
Your first hurdle to overcome is that the From/to values in the mappings are not in ascending order. Then your Type/Code values in the #trades table are also not in...
February 15, 2021 at 2:59 pm
Are you truly still using SQL 2008? I can't remember if ROW_NUMBER() was introduced yet.
If it was available in 2008, then this should help
DECLARE @CustomerOrder table (
...
February 4, 2021 at 12:38 pm
So, we have 2 problems to solve
Bert's solution can be tweaked to 1st consolidate the overlapping sets, then calculate the islands, and finally do our range...
February 4, 2021 at 8:24 am
This will solve the data as you have provided it.
However, what happens when you have multiple overlapping units?
DECLARE @UnitMembership table (
IdentityID int NOT...
February 2, 2021 at 8:59 am
There is a way to get sequential numbers for each child (lineitem) record, starting at some specific value.
Note, that on a very busy system, this could cause a bottleneck.
Create a...
February 2, 2021 at 6:26 am
Viewing 15 posts - 256 through 270 (of 1,464 total)