Viewing 15 posts - 2,281 through 2,295 (of 3,544 total)
OK assuming by your first post that
1. You do not know how many columns are in the table
2. The numbers in the column names are not consecutive
3. ID is always...
Far away is close at hand in the images of elsewhere.
Anon.
July 1, 2005 at 4:29 am
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) & ":" &...
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
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)...
Far away is close at hand in the images of elsewhere.
Anon.
June 27, 2005 at 10:25 am
see
http://www.sqldts.com/default.aspx?254
whilst it refers to DTS the problem is the same
Far away is close at hand in the images of elsewhere.
Anon.
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
...
Far away is close at hand in the images of elsewhere.
Anon.
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
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
June 23, 2005 at 7:43 am
Viewing 15 posts - 2,281 through 2,295 (of 3,544 total)