Viewing 15 posts - 406 through 420 (of 1,464 total)
I would start by using an INNER JOIN, rather than a sub-query
SELECT cs.SuppllierID
FROM CommoditySupplier AS...
November 11, 2019 at 12:54 pm
As a general rule of thumb, you want to avoid looping.
So, I would be looking to rewrite the proc that is being called from the loop to process the data...
November 11, 2019 at 11:20 am
If you have the value of the SetOptions, this will identify what options are ON|OFF
DECLARE @options int = 4347;
SELECT so.SetOption
, OptionState =...
November 8, 2019 at 2:02 pm
Hye all,
My below T-SQL is that accurate calculation?
SELECT
get_customeVal_3 = ISNULL( SUM( CASE WHEN year_num = 2015 AND chart_code <> '36101' AND chart_code <> '39102'...
November 8, 2019 at 3:38 am
Something like this?
DECLARE @batch_Id uniqueidentifier = '4245a9c9-4e34-4178-94f9-002a0fe7846b';
DECLARE @year1 int = 2014; /*current year*/
DECLARE @year2 int = 2013; /*last year*/
WITH cteBase AS (
SELECT ...
November 7, 2019 at 3:51 pm
Although Jonathan's solution works for the given sample data, I believe that this is actually an ISLANDS problem.
Unfortunately, I don't have the time to put together a solution at this...
November 7, 2019 at 6:05 am
The syntax appears to be correct
November 6, 2019 at 5:18 pm
What didn't work? How are we supposed to help you debug when you don't give us anything to work with?
Perhaps you are looking for the machine name, and not the...
November 6, 2019 at 8:16 am
Show us what you have tried, and what you are trying to achieve.
Then we can assist you to correct any errors in the code.
November 1, 2019 at 3:44 pm
You would get much better performance by creating an inline Table Valued Valued Function (iTVF).
Something like this
CREATE FUNCTION dbo.fnPadNum (
@Num ...
October 31, 2019 at 11:37 am
I have used the following pattern for similar requirements
CREATE PROCEDURE Foo
@FilterCondition ....
, @PageNum int = 1
...
October 31, 2019 at 9:58 am
Try these 2 queries
UPDATE EmpNameTable
SET Empname = Empname + '_OLD'
WHERE Empname NOT LIKE '%[_]OLD' -- Do not update when already updated
AND Empname NOT LIKE '85%'...
October 31, 2019 at 9:00 am
So, you already have the last day of the month. Just subtract 1 day and you'll have the second last day
select DATEADD(DAY, -1, DATEADD(MONTH, DATEDIFF(MONTH, -1, GETDATE())-1,...
October 31, 2019 at 4:20 am
It comes in file and then we have SSIS package to insert it into SQL table which has data type of varchar. Now when we want to use the...
October 30, 2019 at 7:59 pm
The ONLY way top guarantee the order of the order of the ordering of the result set is to use an ORDER BY.
October 30, 2019 at 3:33 am
Viewing 15 posts - 406 through 420 (of 1,464 total)