Viewing 15 posts - 1,456 through 1,470 (of 1,472 total)
Left Joins with an COALESCE?
CREATE VIEW SSCTempView
AS
SELECT A.T1IDent, COALESCE(B.Value, C.Value) MyValue
FROM Table1 A
LEFT JOIN Table2 B ON A.T1Ident = B.T2Ident
LEFT JOIN Table3 C ON A.T1Ident = C.T3Ident
October 1, 2008 at 9:18 am
Same method from the previous question should fix this. Select the results into a temp table and insert from there.
October 1, 2008 at 9:06 am
You aren't storing the data you are selecting from the remote server anywhere.
Instead of
select @TSQL = 'select * FROM OPENQUERY(amisole, ''select room_code,asset_tag,description FROM asset where location_code = '''''...
October 1, 2008 at 8:52 am
Tested the above patindex string under 2K and it works fine.
OP:In your third example, you split the string twice. You will need to run the previous solution...
September 30, 2008 at 1:49 pm
As far as it trying to insert into the identity column, you can get around that by just explicity defining the fields you are inserting into:
insert into #Ranking (MBR_Race_ID, Team_Points,...
September 30, 2008 at 7:52 am
What is your end goal here? There is probably a more efficient way to accomplish what you're asking. For example, tracking both the next and previous ID's per...
September 18, 2008 at 3:57 pm
Is the data you supplied an actual example of your how data table is structured, or is that just to help explain what you need? If the latter, how...
September 18, 2008 at 9:12 am
Yes! I finally get to use a cross join for something!
Setup:
CREATE TABLE #Gender(
Gendervarchar(10))
INSERT INTO #Gender(Gender)
VALUES('Male')
INSERT INTO #Gender(Gender)
VALUES('Female')
INSERT INTO #Gender(Gender)
VALUES('Unkown')
CREATE TABLE #Age(
Agevarchar(10))
INSERT INTO #Age(Age)
VALUES('13-17')
INSERT INTO #Age(Age)
VALUES('18-24')
INSERT INTO #Age(Age)
VALUES('25-29')
INSERT INTO #Age(Age)
VALUES('30-39')
INSERT...
September 17, 2008 at 11:39 am
REPLACE(@FilterCondition1, '~~', '~0~')
You can put that inline with where you're splitting the rest of your string. Replace the Zero with whatever character you need for that value to show...
September 17, 2008 at 6:04 am
Due to the nature of our setup, involving a complete custom built front end application, which only communicates through a custom built middle layer(which we have no access to modify...
September 16, 2008 at 3:02 pm
You're looking for something like this?
Declare @StartTimedatetime,
@EndTimedatetime,
@Totalint
SELECT Client, datepart(hh, YourDate) HourNumber, SUM([NumRows]) VRowCount
INTO #1
FROM YourTable
WHERE YourDate BETWEEN @StartTime and @EndTime
GROUP BY Client, datepart(hh,YourDate)
SET @Total = (SELECT SUM(VRowCount)
FROM #1)
SELECT Client, HourNumber,...
September 16, 2008 at 1:21 pm
I'd also consider running a Trace and specifying textdata of:
'%proc_insertorderdetails%' with SPStmtStarting, SPStmtCompleted, RPC:Completed and SQL:BatchCompleted turned on. That way, you will be able to see exactly how the...
September 16, 2008 at 6:58 am
We do... for any fields that we are able to change. However, some fields we can't change without getting our front end or middle layer modified. That one...
September 16, 2008 at 6:40 am
Getting back to my initial suggestion... aside from it being potentially slow / reliant on a '-' as a delimiter, is there any reason that wouldn't have worked?...
September 16, 2008 at 6:20 am
Viewing 15 posts - 1,456 through 1,470 (of 1,472 total)