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...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
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...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
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
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
March 19, 2009 at 9:02 am
try this one.
SUBSTRING([YOURCOLUMN],PATINDEX('%MYNAME: %',[YOURCOLUMN])+8,DATALENGTH([YOURCOLUMN]))
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
March 19, 2009 at 7:20 am
ah you using a text field, that changes things
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
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 ...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
March 19, 2009 at 7:01 am
not sure which is faster but here is another:
SELECT RIGHT(@String,PATINDEX('% :EMANYM%',REVERSE(@string))-1)
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
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))
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
March 19, 2009 at 6:32 am
could you show us what you have so far?
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
March 19, 2009 at 4:34 am
Thanks Steve,
sorry for the late reply.
It's all working 100% now 🙂
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
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...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
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...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
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...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
March 18, 2009 at 5:24 am
along with what has already been mentioned above , have you updated the statistics?
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
March 18, 2009 at 4:11 am
Have you tried looking up in BOL for Recursive CTE's?
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
March 17, 2009 at 10:11 am
Viewing 15 posts - 301 through 315 (of 1,082 total)