Viewing 15 posts - 3,556 through 3,570 (of 6,036 total)
Jeff Moden (21/09/2007)
September 23, 2007 at 11:44 pm
If you use the design I am suggesting, the PK of the parent table is part of each and every child table. (does this add space to your system? YES!!!)...
September 23, 2007 at 11:19 pm
Number of opened and closed brackets in one of your lined don't match.
September 23, 2007 at 2:15 pm
AND ws.CreateDateTime >= @start
AND ws.CreateDateTime < @last
causes table scan.
FOr this query you should have clustered index on ( WorkOrders_ID, ServiceEvents_Code, CreateDateTime ).
But if you perform a...
September 21, 2007 at 6:45 pm
Remove comma before 2st "FROM" and remove all semicolons (";") from the script.
September 21, 2007 at 2:28 am
Easy.
If you update/insert more than 1 row.
September 20, 2007 at 2:25 pm
Craig,
as I said, it's not a run-time error.
If in any .Net language you call a method which is not declared - can you catch this error?
No, such code will fail...
September 20, 2007 at 5:07 am
As Jeff suggested, use sp_ExecuteSQL.
Same way as you've been told in another your thread:
EXEC @Error = sp_ExecuteSQL @sql, N'@param1 datatype, @param2 datatype, ...', {parameters}
See BOL for more details.
September 20, 2007 at 3:22 am
By the way,
Craig, don't use
if not exists(select 1 from tempdb.sys.objects where name = '#fred')
Not every user in every environment could have permissions to query system tables in system databases.
Not...
September 19, 2007 at 11:32 pm
I know.
There is nothing to debate.
It's just impossible for you to admit you're wrong or did not know something.
No more issues here.
September 19, 2007 at 11:26 pm
You must tell what binds "header" row to "details" rows.
If you know this key then it's simple:
SELECT
{record set 1)
UNION ALL
SELECT
{record set 2)
ORDER BY KeyColumn
September 19, 2007 at 11:12 pm
Patience!
It's only 5pm here.
I need to pretend working for another hour!
![]()
September 19, 2007 at 11:10 pm
As soon as you add missing columns to 2nd record set you need to use UNION ALL to unite them together and sort final result by some key value which...
September 19, 2007 at 9:43 pm
You welcome.
Always happy to wash someone's brains. ![]()
September 19, 2007 at 9:37 pm
Lynn,
There is need.
You just don't know how it works.
So, do the exercise and learn something.
SP will be recompiled every time it reaches the point where temp table is referenced.
If you...
September 19, 2007 at 9:34 pm
Viewing 15 posts - 3,556 through 3,570 (of 6,036 total)