Viewing 15 posts - 196 through 210 (of 430 total)
I don't think that would work david. Let us try to add few more rows in TBL_A and TBL_B. It would be impossible unless there is a definite way to...
August 17, 2005 at 8:25 am
Can you post the full query. Posted query and the following would give the same result set.
SELECT DISTINCT [Baseball65K24].[Col005])
FROM
[Baseball65K24]
LEFT OUTER JOIN
[Baseball65K50]
ON
[Baseball65K50].[Col007] = [Baseball65K24].[Col005]
WHERE
[Baseball65K50].[Col007] IS NULL
ORDER BY
[Baseball65K24].[Col005]
Also what is the...
August 17, 2005 at 8:05 am
As Remi mentioned design can be different and better.
Anyway for existing design updating using a loop will be a performance problem for large data rows. I would do it like
SET...
August 17, 2005 at 8:00 am
This design will take more stages
SET NOCOUNT ON
DECLARE @dataTable TABLE
(
RowID INT IDENTITY,
CaseNo INT,
StageStatus INT
)
INSERT @dataTable (CaseNo, StageStatus)
SELECT 1, 1 UNION ALL
SELECT 1, 2 UNION ALL
SELECT 1, 2 UNION ALL
SELECT 1, 2 UNION ALL
SELECT 1, 3
DECLARE @statusTable...
August 16, 2005 at 3:06 pm
SET NOCOUNT ON
DECLARE @dataTable TABLE
(
CaseNo INT,
Stage1Status INT,
Stage2Status INT,
Stage3Status INT
)
INSERT @dataTable
SELECT 1, 2, 2, 3
DECLARE @statusTable TABLE
(
stageValue INT,
stageName VARCHAR(100)
)
INSERT @statusTable
SELECT 1, 'Not started' UNION
SELECT 2, 'Processing' UNION
SELECT 3, 'Completed'
SELECT A.CaseNo,
B.stageName,
C.stageName,
D.stageName
FROM
@dataTable A
JOIN
@statusTable B
ON
A.Stage1Status = B.stageValue
JOIN
@statusTable C
ON
A.Stage2Status =...
August 16, 2005 at 2:53 pm
How do you relate '12345' ID in Table B with '666888' ID in Table A
August 16, 2005 at 2:07 pm
This will work. I am not sure about a way to convert into datetime without a space between date and time in T-SQL.
SET NOCOUNT ON
DECLARE @myTable Table
(
MyDateString VARCHAR(20)
)
INSERT @myTable
SELECT '2005081607:58:26:170' UNION
SELECT...
August 16, 2005 at 9:30 am
You miss a space between date and time
DECLARE @MyDate DATETIME
SET @myDate = '20050816 07:58:26:170'
SELECT CONVERT(DATETIME, '20050816 07:58:26:170') WithConvert, @myDate Implicit
August 16, 2005 at 8:52 am
Adding a parameter is done with
Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")
MyParam.Name = "@SRhospitalCanvass"
MyParam.Value = SRhospitalCanvass
MyParam.Size = 10
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
This can be done in one line like to...
August 16, 2005 at 8:40 am
Thank You Wayne Lawton I did the solution similar to that. I thought there might be a way other than dynamic query. I...
August 15, 2005 at 8:43 am
Do you miss a
and a.softname = b.softname in the query
select a.editor, a.softname, a.version, count(a.hostname)total,
case when suite = 0 then 'NO'
ELSE 'YES'
END AS Suite
from SLIB_RESULTS a
join (select max(version)...
August 12, 2005 at 10:44 am
If this is what you want.
HTH
SET NOCOUNT ON
DECLARE @MyTable TABLE
(
MyName VARCHAR(10),
MyNum INT
)
INSERT @MyTable
SELECT 'AAA', 555 UNION
SELECT 'BBB', 888 UNION
SELECT 'CCC', 999 UNION
SELECT 'DDD', 777 UNION
SELECT 'EEE', 888 UNION
SELECT 'TTT', ...
August 12, 2005 at 9:41 am
This will fetch a row but not the row in a row position. For that we must specify a where condition.
SET ROWCOUNT 1
SELECT * FROM myTable
OR
SELECT TOP 1 * FROM...
August 12, 2005 at 9:14 am
SET NOCOUNT ON
DECLARE @BL_TRUCK_BOL_DEST TABLE
(
bol_no VARCHAR(10),
dest_bol_no VARCHAR(10)
)
INSERT INTO @BL_TRUCK_BOL_DEST VALUES ('00001', '2BT')
INSERT INTO @BL_TRUCK_BOL_DEST VALUES ('00001', '1BT')
INSERT INTO @BL_TRUCK_BOL_DEST VALUES ('', '4BT')
INSERT INTO @BL_TRUCK_BOL_DEST VALUES ('', '5BT')
DECLARE @bol_no VARCHAR(10)
DECLARE @dest_bol_no VARCHAR(10)
SELECT @bol_no =...
August 10, 2005 at 9:36 am
Yes I was about to tell if there is no relationship then for each row in clientmaster all the rest of the rows will be repeated.
Why do you...
August 10, 2005 at 9:18 am
Viewing 15 posts - 196 through 210 (of 430 total)