Viewing 15 posts - 49,351 through 49,365 (of 49,571 total)
Has someone perhaps put a trigger on the table?
November 2, 2005 at 12:50 am
CREATE TABLE #Temp (
... -- columns matching output of stored proc
)
INSERT INTO #Temp
EXEC StoredProcedure @Params ...
The limitation is that the stored proc must return only one reordset.
November 1, 2005 at 11:48 pm
Generated at runtime, as far as I know. Makes sense, since sps can return completely different resultsets for different callings.
October 28, 2005 at 2:13 am
Thanks for the comments. I'm leaning towards 70-290. I'll probably do 291 at a later date.
Yelena: you're right, I don't work for a small company. I work for the corperate...
October 28, 2005 at 1:15 am
The way I wrote that query it should only return one reply per post, unless you have replies with identical dates.
Can you please post some example data and your...
October 28, 2005 at 12:06 am
Specify the table for all the columns. I didn't know what your tables looked like, so I too a guess. My bad.
SELECT TOP 20
October 27, 2005 at 5:18 am
What's with all the declared but unused variables?
You've got an error handling block, but no error checking anywhere.
October 27, 2005 at 4:16 am
Doesn't matter how you capture the data. You've got 15 fields all storing the same thing in one table. That's bad db design. It may make the capturing easier, but...
October 27, 2005 at 2:43 am
A subselect in the SELECt clause can only return 1 field. Join it is as a subquery.
Do you want the latest reply for a post? (assuming so for the below...
October 27, 2005 at 2:34 am
Can you fix the database design? At the moment it's violating first normal form (table contains repeating groups). What happens if it's decided that a month of data needs to...
October 27, 2005 at 2:13 am
I just glanced over it quickly, but I've got a feeling that it can be optimised a bit.
Can you please post table definitions, sample data and expected output. Also the...
October 26, 2005 at 1:18 am
No problem. What part don't you understand?
The case statement takes the day of the week (Sunday=1, Monday=2,....) and based on that decides how many days to add to get 7...
October 24, 2005 at 12:26 am
Not particuarly elegent, but it works.
set datefirst 7
DECLARE @DayOfWeek TINYINT
SET @DayOfWeek=datepart(dw,getdate())
select DATEADD(dd,CASE WHEN @DayOfWeek<5 THEN 9 WHEN @DayOfWeek=7 THEN 10 ELSE 11 END, GETDATE())
For today (Thurs 20th Oct) this returns...
October 20, 2005 at 12:46 am
No. Stored procedures may have output parameters but functions may not. See the following from BoL.
A user-defined function takes zero or more input parameters and returns either a scalar value...
October 19, 2005 at 1:03 am
A job that runs once a day would work.
Job checks for all records where datediff(dd,TraceDate,GETDATE())=7 AND TRStatus='Closed' The =7 ensures that the same record won't get flagged two days...
October 19, 2005 at 12:53 am
Viewing 15 posts - 49,351 through 49,365 (of 49,571 total)