Viewing 15 posts - 14,416 through 14,430 (of 14,953 total)
Jeff Moden (4/1/2008)
GSquared (4/1/2008)
April 1, 2008 at 4:09 pm
And for a little more housecleaning, I'd replace:
CREATE Table #CertType (
Type VARCHAR(50),
XID INT
)
INSERT iNTO #CertType
SELECT DISTINCT Type, XID...
April 1, 2008 at 3:44 pm
Replace:
and 1 =
case
when @CertType is null then 1
else
case
...
April 1, 2008 at 3:42 pm
Since you've already hard-coded all of this part:
Create TABLE #CertStatus (
StatusID INT,
StatusDesc CHAR(20)
)
INSERT INTO...
April 1, 2008 at 3:36 pm
Change:
ProcessDate BETWEEN @yesterday AND @today
to:
ProcessDate >=@yesterday AND processdate < @today
Otherwise, you'll run the risk of getting data from midnight last night (technically today) in the mix.
April 1, 2008 at 3:28 pm
That one's Left Outer (as previously noted).
!= is not equal.
April 1, 2008 at 3:25 pm
Okay. Now I can follow what's going on.
You have a trigger that uses a cursor to call a proc that uses a cursor to call another proc that calls...
April 1, 2008 at 3:06 pm
Thinking about another post on this same thread, there is another solution, which would be to have every proc that needs the hierarchy create a temp table around a specific...
April 1, 2008 at 2:53 pm
TheSQLGuru (4/1/2008)
1) most code doesn't actually GET reused because a) all devs don't know about it, b) devs don't bother checking to see if their...
April 1, 2008 at 2:36 pm
TheSQLGuru (3/31/2008)
GSquared (3/31/2008)
April 1, 2008 at 11:57 am
Andre, I must be missing something. Your updateSettings proc doesn't seem to actually do anything except call itself recursively. I don't see any update/insert/delete commands in it. ...
April 1, 2008 at 11:44 am
You're welcome.
Without the temp table, you'd quickly run into the problem of too many selects, which Management Studio will bomb out on.
Of course, it's a really bad idea to run...
April 1, 2008 at 11:24 am
select dateadd(month, 1, cast(enddate + '01' as datetime)) - 1
from dbo.sasimp
Should give you what you need. If it gives you an error about converting enddate to varchar, try this:
select...
April 1, 2008 at 11:15 am
I modified the script as follows:
create table #Test (
DB varchar(100),
TableName varchar(100),
RowQty int)
DECLARE @dbname VARCHAR(50)
DECLARE @string VARCHAR(2500)
DECLARE db_cursor CURSOR
FOR SELECT name
...
April 1, 2008 at 9:15 am
I'm going to hazard a guess that [Date] and/or [DateImport] are datetime columns with the date AND the time in them. In which case, your Group By is almost...
April 1, 2008 at 8:46 am
Viewing 15 posts - 14,416 through 14,430 (of 14,953 total)