Viewing 15 posts - 12,406 through 12,420 (of 14,953 total)
I would change the SFound thing to an If Exists or If Not Exists. It should, however, work as written, and this is a minor change and not critical.
The...
August 6, 2008 at 12:25 pm
This sounds like a test question to me. Or an interview question. Do you have a specific situation you are trying to resolve?
August 6, 2008 at 12:16 pm
Jeremy Brown (8/6/2008)
GSquared (8/6/2008)
You can't defrag a table that doesn't have a clustered index. Simple as that.
Sure you can! Put a clustered index on the table.
Ok, I know...
August 6, 2008 at 12:00 pm
What kind of connection are you trying to establish? What application? Are you on the other side of a firewall from the server?
August 6, 2008 at 11:14 am
Since I'm over 30, and "learned me some SQL" from someone over 30, I guess you should disregard anything I have to say on this, but here goes:
Spend time on...
August 6, 2008 at 11:09 am
You can either use exec(@qrystr) or use sp_executesql. Tend towards sp_executesql, since it at least slightly reduces the dangers of dynamic SQL (which is what this is).
August 6, 2008 at 11:03 am
I'm going to hazard a guess that either one of the servers has the wrong date on it, or someone set the calendar ahead one day to test something (or...
August 6, 2008 at 11:00 am
Jeff Moden (8/6/2008)
August 6, 2008 at 10:59 am
declare @DHire datetime
select @dhire = '6/2/2008'
select
case
when datepart(day, @dhire+30) = 1 then @dhire + 30
else dateadd(day, -1 * datepart(day, @dhire+30), dateadd(month, 1, @dhire+30))+1
end
Test it with a few dates. Should...
August 6, 2008 at 10:02 am
cast(replace('2007/01/01', '/', '') as int)
If you cast/convert a datetime value to Int, you'll end up with the number of days since 1/1/1900, not the format you're looking for. The...
August 6, 2008 at 9:58 am
It's a service. Right click "My Computer" or "Computer" (depending on your server version), select Manage, go to Services, make sure it's running and is set to start using...
August 6, 2008 at 9:55 am
Both turned on, and scheduled maintenance plans to update stats periodically and rebuild certain indexes.
August 6, 2008 at 9:54 am
Viewing 15 posts - 12,406 through 12,420 (of 14,953 total)