Viewing 15 posts - 586 through 600 (of 1,082 total)
You know the situation is bad, when you need a job to pay the taxes of another job 🙂
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
November 5, 2008 at 10:24 am
Hi
This is a basic example you may need to change it if you don't want leading spaces etc.
DECLARE @string VARCHAR(100)
SET @string = '123-458-856 -AD45 EXP 01/01/01'
SELECT
@string as [My...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
November 5, 2008 at 10:22 am
try something like this:
SELECT
[Col1],
[Col2],
COUNT(*) as [Number of Dups]
FROM [MyTable]
GROUP BY --Use this for the rows you are comparing
[Col1],
[Col2]
HAVING COUNT(*) > 1 --Only return rows where there are more than...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
November 5, 2008 at 10:16 am
Hi,
SELECT COUNT(DISTINCT ...)
Will return a count unique of none-null values
SELECT DISTINCT COUNT(...)
Will return a distinct value for the count of all none-null values
Add an extra column to a DISTINCT...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
November 5, 2008 at 9:27 am
Once upon a database there was a scary database owner.
One day the database owner created lots of tables full of sweets.
The following day an Index tried to scan some of...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
October 31, 2008 at 10:22 am
HI There,
try using the SET DATEFORMAT So that the system knows how to read your string.
e.g
SET DATEFORMAT dmy
DECLARE @val VARCHAR(100)
SET @val = '27/08/2008 05:37'
SELECT CAST(@val as DATETIME)
Thanks
Chris
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
October 31, 2008 at 10:05 am
Sorry Guru,
I totally understand.
I guess I was just hoping that someone would spot a QUICK lucky fix for me.
wishful thinking I guess
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
October 28, 2008 at 10:00 am
HI all,
I think this is all the information need with regards to the from clauses of the views and that tables with there row counts and all the indexes on...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
October 28, 2008 at 9:28 am
HI all,
OK the view can't be indexed cause it has left joins in it 🙁
Oh I also can't use temp tables cause the query is created dynamically by our Website...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
October 28, 2008 at 9:11 am
HI all,
Thanks for all the support.
The wierd thing is that the where clause is on a table that only has 170+- rows in it.
It seems that the problem is coming...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
October 27, 2008 at 8:57 am
HI Grant,
Ok there are no nest table functions, so I'll try and do a another stats update but with full scan this time.
After that I'll have to supply the tables...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
October 24, 2008 at 1:57 am
OK two problems I'm told.
1 - Can't use the force casue our website builds the query so we can't use the force all the time incase it affects other queries....
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
October 23, 2008 at 10:02 am
The views are not indexed
I'll have a look at indexing them and see if it makes a difference.
just wierd that the force order works 🙁
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
October 23, 2008 at 9:23 am
no
looks like I might not beable to implement the force plan.
So I'm hoping someone could help me with the difference in plans I already supplied
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
October 23, 2008 at 8:44 am
OK might have found a solution but I'd like to know the impact.
Adding a OPTION (FORCE ORDER)
to the end of the query makes it run super fast.
What are the draw...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
October 23, 2008 at 8:35 am
Viewing 15 posts - 586 through 600 (of 1,082 total)