Viewing 15 posts - 301 through 315 (of 1,082 total)
and you sure that the non-clustered index doesn't have INCLUDE columns?
If not then I would go with Lynn on this one, the index is not need, and may end up...
March 19, 2009 at 9:50 am
I'm gonna try and teach you to work this one out, so you can understand how some of the SQL functions work.
What you need to do is this. (use BOL...
March 19, 2009 at 9:26 am
if it's always going top be 4 charaters then just use SUBSTRING with a lenght of 4.
Look at BOL for how to use substring
March 19, 2009 at 9:02 am
try this one.
SUBSTRING([YOURCOLUMN],PATINDEX('%MYNAME: %',[YOURCOLUMN])+8,DATALENGTH([YOURCOLUMN]))
March 19, 2009 at 7:20 am
ah you using a text field, that changes things
March 19, 2009 at 7:15 am
just replace my variable with your column name in your code and your done...
for example:
select
incident.naam as Incident_Nr,
incident.datumaangemeld as Datum_Aanmelden,
incident.verzoek as Omschrijving,
RIGHT(incident.verzoek,PATINDEX('% :EMANYM%',REVERSE(incident.verzoek))-1)
from
incident
INNER JOIN classificatie ...
March 19, 2009 at 7:01 am
not sure which is faster but here is another:
SELECT RIGHT(@String,PATINDEX('% :EMANYM%',REVERSE(@string))-1)
March 19, 2009 at 6:38 am
are always going to remove everything before and including "..MYNAME:" ?
Is so then here is solution
DECLARE @string VARCHAR(MAX)
SET @string = '01-09-2008 09:07 MYNAME: This is the result text....'
SELECT SUBSTRING(@string,PATINDEX('%MYNAME: %',@string)+8,LEN(@string))
March 19, 2009 at 6:32 am
Thanks Steve,
sorry for the late reply.
It's all working 100% now 🙂
March 19, 2009 at 3:09 am
try something like this.
CREATE VIEW mynewview
AS
WITH MyCTE AS
(SELECT a.col1,a.col2,b.col3,b.col4,b.col5,
colMask = CASE
WHEN ((b.col3 % 8) /4) >= 1 THEN 'Submit'
WHEN ((b.col3 % 16) /8) >= 1 THEN 'Modify'
ELSE 'None'
END
FROM mytable...
March 18, 2009 at 7:36 am
try this:
CREATE VIEW AS mynewview
SELECT a.col1,a.col2,b.col3,b.col4,b.col5,
colMask =
CASE
WHEN ((b.col3 % 8) /4) >= 1 --'Submit'
THEN CASE
WHEN ((b.col3 % 16) /8) >= 1 --'Modify'
THEN 'Submit,Modify'
ELSE 'Submit'
END
WHEN ((b.col3...
March 18, 2009 at 7:22 am
The plan is to be expected to be honest, I'm just trying to work out how to get rid of the Key Look-up as this is where the big cost...
March 18, 2009 at 5:24 am
along with what has already been mentioned above , have you updated the statistics?
March 18, 2009 at 4:11 am
Have you tried looking up in BOL for Recursive CTE's?
March 17, 2009 at 10:11 am
Viewing 15 posts - 301 through 315 (of 1,082 total)