Viewing 15 posts - 16 through 30 (of 53 total)
Luis Cazares (9/4/2014)
Sowbhari (9/4/2014)
I wouldn't recommend using JOIN or APPLY because it could generate duplicates. In this case, I prefer to use IN or EXISTS.
Hi Luis C., could you please...
September 4, 2014 at 9:21 am
I wouldn't recommend using JOIN or APPLY because it could generate duplicates. In this case, I prefer to use IN or EXISTS.
Hi Luis C., could you please explain a little...
September 4, 2014 at 9:07 am
You can find the code and the article in the below link
September 1, 2014 at 10:38 am
Try the below code. You will need to have the DelimitedSplit8k function created. Please read the article here[/url] to understand how the function works and the code.
DECLARE @myvendedor AS varchar(255)
SET...
September 1, 2014 at 10:17 am
If you can hold the column data in a variable for which you want to replace special characters the below might work
DECLARE @a NVARCHAR(100)
SELECT @a =...
March 21, 2014 at 7:25 am
Will this help
;WITH Nums (i,j,k) AS
(
SELECT 1,4,2 UNION ALL
SELECT 1,6,2 UNION ALL
SELECT 2,4,2 UNION ALL
SELECT 2,6,2 UNION ALL
SELECT 3,4,2 UNION ALL
SELECT 3,5,2
)
SELECT B.j
FROM (SELECT COUNT(DISTINCT i) Cnt FROM Nums) AS...
March 18, 2014 at 8:21 am
ChrisM@Work (3/4/2014)
SELECT DATEDIFF(dd,0,GETDATE())-1
SELECT DATEADD(dd,DATEDIFF(dd,0,GETDATE())-1,0)
SELECT DATEADD(hh,18,DATEADD(dd,DATEDIFF(dd,0,GETDATE())-1,0))
Use q3. q1 and q2 help explain the algorithm.
Chris solution is obviously better than the below but if you do not want the seconds part then...
March 4, 2014 at 8:28 am
Try the below...
UPDATE A
SET A.MARKET_VALUE = B.MARKET_VALUE
FROM @Emp AS A INNER JOIN
(
SELECT 'DIVERSE' AS RISK_FACTOR,
SUM(CASE RISK_FACTOR WHEN 'ALL' THEN MARKET_VALUE*-1
ELSE MARKET_VALUE END) MARKET_VALUE,
CUT_DESC,PROCESS
FROM @Emp
WHERE RISK_FACTOR <> 'DIVERSE'
GROUP BY CUT_DESC,PROCESS
) AS...
February 21, 2014 at 11:02 am
You will need to specify the server name where the database MYdb is held
EXEC xp_cmdshell 'bcp "SELECT * FROM [MYdb].[dbo].[TB40] WHERE
LEFT (ZZ, 2) IN (''Is'', '''MS', ''OS'', ''SM'')
AND YEAR (MAX([theDate]))...
February 20, 2014 at 6:51 am
If you open the .dtsx file in a notepad, what does the text qualifier property show
<DTS:Property DTS:Name="TextQualifier" xml:space="preserve">_x0022_</DTS:Property>
OR
<DTS:Property DTS:Name="TextQualifier" xml:space="preserve">"</DTS:Property>
If it is the first option then try changing to the...
February 20, 2014 at 5:35 am
What are the TextQualifier & ColumnDelimiter properties set to currently?
February 19, 2014 at 11:22 am
Will this help...
DECLARE @Hourly INT
SELECT @Hourly = 1
SELECT Col1,Col2 FROM TableA
WHERE
(CASE WHEN @Hourly = 1 THEN TableA.LoadDateTime
ELSE CONVERT(VARCHAR(8),TableA.LoadDateTime,112)
END) >=
(CASE WHEN @Hourly = 1 THEN @TodaysDate
ELSE CONVERT(VARCHAR(8),@TodaysDate,112)
END)
February 19, 2014 at 10:47 am
May be there are non-printable characters in the code you might have copied from your script files that are not visible in SSMS. What happens if you open a new...
February 19, 2014 at 9:59 am
This might not be the best solution...but it works on your sample data.
DECLARE @Id INT
SELECT @Id = 1
;WITH Hierarchy AS
(
SELECT * FROM @TransactionComponents
WHERE pktransactionid = @Id
UNION ALL
SELECT * FROM @TransactionComponents
WHERE...
February 19, 2014 at 8:49 am
Viewing 15 posts - 16 through 30 (of 53 total)