Viewing 15 posts - 526 through 540 (of 598 total)
Here's a start:
declare @test-2 varchar(20),
@C char(1),
@numstr varchar(20)
select @test-2 = '123 Add7ress 56',
@numstr = ''
while len(@test) > 0
begin
May 3, 2006 at 11:36 am
SELECT @RetVal = ReviewBy
FROM dbo.review
WHERE ItemID = @ItemID
ORDER BY ReviewBy DESC
May 3, 2006 at 10:03 am
try this:
set rowcount 1
select field-item, cost, field-effective-date
from MyTable
where field-item = '123'
ORDER BY field-effective-date DESC
--or--
select TOP 1 field-item, cost, field-effective-date
from MyTable
where field-item = '123'
ORDER BY field-effective-date DESC
May 3, 2006 at 9:08 am
if the email column in tContact is a nullable column and those entries are null, this is the expected result.
Try this:
select q.email, c.email
from t_Quote q
LEFT OUTER JOIN t_contact c
on...
May 3, 2006 at 8:57 am
Well not quite...
BETWEEN '2006-05-01 00:00:00.000' AND '2006-05-01 11:59:59.000'
would only get you until a minute before lunch (depending on your date format and work schedule, that is...).
May 3, 2006 at 8:32 am
You wouldn't get any results, unless you had an entry for exactly midnight. To put it in terms of simple math, that's the same as asking for values between 1...
May 3, 2006 at 8:14 am
One note: building on Wayne's example, you probably want to make @temp3 varchar(20) - the sum of the length of @temp1 and @temp2.
May 3, 2006 at 8:06 am
Away from SQL, I'm managing a household with 3-5 adults, 9 chihuahuas (http://s2.photobucket.com/albums/y36/pdianne/Puppies/) and a Timneh African Gray parrot (http://s2.photobucket.com/albums/y36/pdianne/PDG/). Other than that I am involved with various social and political...
May 2, 2006 at 4:04 pm
Then your first step is to identify which of those queries are the worst-performing ones. Take a look here for some hints onthat:
http://www.sql-server-performance.com/sql_server_performance_audit10.asp
May 2, 2006 at 3:31 pm
Plug the SQL into query analyzer and look at the query plan.
Post the SQL (and DDL) here and let us take a look.
May 2, 2006 at 3:16 pm
Do you want it by distinct account numbers or by the distinct substring? For the former go with Terry's solution. For the latter, change the Group by to:
Group by substring(ad.account_number,1,2)
May 2, 2006 at 2:08 pm
Then there's QUOTENAME()
see: http://msdn2.microsoft.com/en-us/library/ms176114(SQL.90).aspx
for reference.
May 2, 2006 at 12:03 pm
Look at the query plans. Run some index tuning traces.
That's truly the only way to know what is causing the performance hit.
Have a look at this: http://blogs.msdn.com/sqlcat/archive/2006/02/13/531339.aspx
Duplicate indexes...
May 2, 2006 at 11:59 am
Is it just me, or does the question (especially the first part) make no sense?
May 2, 2006 at 7:25 am
Viewing 15 posts - 526 through 540 (of 598 total)