Viewing 15 posts - 2,281 through 2,295 (of 3,543 total)
Try it like this
if DTSSource("Col009") = null then
DTSDestination("Col009") = null
else
DTSDestination("Col009") = mid(DTSSource("Col009"),1,4) & "/" & mid(DTSSource("Col009"),5,2) & "/" & mid(DTSSource("Col009"),7,2) & " " & mid(DTSSource("Col009"),9,2) & ":" &...
June 30, 2005 at 8:49 am
I'd be interested in comments this this
I only use single transactions whether or not I call multiple procedures.
And if BOL (SQL2K) is to...
June 30, 2005 at 7:33 am
Date transformation in DTS is not very forgiving and either poorly formatted dates or low value years will cause problems.
In the transformation delete the 'copy column' transformation for the field and...
June 30, 2005 at 7:10 am
SELECT [Number 1] AS [Number] FROM [Number} WHERE [ID] = 1
UNION ALL
SELECT [Number 2] AS [Number] FROM [Number} WHERE [ID] = 1
UNION ALL
SELECT [Number 3] AS...
June 30, 2005 at 6:50 am
OK, so you did not like solution then
The Calendar table contains each date in the input range (built for each query) or a...
June 29, 2005 at 5:04 am
SELECT CASE
WHEN (DATEDIFF(day,@fromdate,@until) + 1) - SUM(DATEDIFF(day,
CASE WHEN @fromdate < fromdate THEN fromdate ELSE @fromdate END,
CASE WHEN @until > until THEN until ELSE @until END...
June 28, 2005 at 10:27 am
DECLARE @fromdate datetime, @until datetime
SET @fromdate = '2005-07-07'
SET @until = '2005-07-14'
SELECT (DATEDIFF(day,@fromdate,@until) + 1) - SUM(DATEDIFF(day,
CASE WHEN @fromdate < fromdate THEN fromdate ELSE @fromdate END,
CASE...
June 28, 2005 at 7:35 am
Add extra property to connection string, e.g.
'Excel 8.0; DATABASE=c:\MyData.xls;HDR=YES'
will use first line of worksheet as column names
'Excel 8.0; DATABASE=c:\MyData.xls;HDR=NO'
will process the first line the same as the rest (as data)...
June 27, 2005 at 10:25 am
June 27, 2005 at 7:54 am
To find the result you are looking for requires the use of dynamic sql which cannot be used in a function, only in a procedure like this
CREATE PROCEDURE usp_GetMaxValue
...
June 27, 2005 at 7:03 am
I suggest checking the varchar data as the data content will most likely give you the 'Error converting varchar to float' error.
e.g. '-' or '.1' will give you the error
June 27, 2005 at 6:19 am
Try adding grouping like this
SELECT @strSQL = 'SELECT ProductID, ProductName, '
WHILE @i <= @t
BEGIN
SET @strSQL = @strSQL +
'MAX(CASE CategoryID WHEN ' +
CONVERT(nvarchar,@i) +
' THEN 1 ELSE 0...
June 24, 2005 at 6:20 am
This might do it
DECLARE @From nvarchar(250), @To nvarchar(250)
SET @From = N'Cat'
SET @To = N'Eva'
SELECT *
FROM EMPLOYEE
WHERE LEFT([NAME],LEN(@From)) >= @From
AND LEFT([NAME],LEN(@To)) <= @To
but performance...
June 24, 2005 at 6:07 am
SELECT a.somereference, a.[date], a.[time], a.status, a.owner
FROM #Table a
INNER JOIN (
SELECT x.somereference, MAX(CAST('1904 '+x.[date]+' '+x.[time] as datetime)) AS [MaxDate]
FROM #Table x
GROUP BY somereference
) b
ON...
June 23, 2005 at 7:43 am
This assumes a maximum of four values with either hyphen or full stop delimiter and a maximum of 4 chars between delimiters
ORDER BY
ISNULL(RIGHT('0000'+PARSENAME(REPLACE([column],'-','.'),4),4),'')+
ISNULL(RIGHT('0000'+PARSENAME(REPLACE([column],'-','.'),2),4),'')+
ISNULL(RIGHT('0000'+PARSENAME(REPLACE([column],'-','.'),3),4),'')+
ISNULL(RIGHT('0000'+PARSENAME(REPLACE([column],'-','.'),1),4),'')
June 23, 2005 at 7:21 am
Viewing 15 posts - 2,281 through 2,295 (of 3,543 total)