Viewing 15 posts - 49,411 through 49,425 (of 49,571 total)
Seriously, if any of my collegues submitted a trigger with...
September 23, 2005 at 12:14 am
'inserted' is only a stub of the new record
Not sure what you mean by that. inserted contains all the fields that are in the table the trigger is on. If...
September 23, 2005 at 12:11 am
Look in Books online. Exists keyword under Transact-SQL reference.
Essentially I'm saying check Table2 for any records that have an ID, CreateDate combo that is in table 1 and exclude them.
It's much...
September 22, 2005 at 6:54 am
Depends what you want to do with the records.
If you have 2 records with the same ID, createdate, modified date and different cardtypes, then which one do you take?
What about same...
September 22, 2005 at 6:02 am
You wouldn't be a developer rather than a DBA would you
Be nice. I'm a developer.
September 22, 2005 at 5:31 am
You've got two completely identical records in ETable1. While your subquery is correctly retrieving no duplicates, as soom as joi do the join back to Etable1, there's a dup sneaking...
September 22, 2005 at 2:48 am
I hate cursors. There's usually a better way....
The way you've written it, if there are multiple rows inserted at once, only one of...
September 22, 2005 at 2:38 am
The only way is to match what's in inserted with the real table is on a unique field or a unique combination of fields. SQL has no concept of row...
September 22, 2005 at 12:07 am
What's the primary key of the table?
As an aside, the way your trigger is written only caters for single row inserts. Try this
IF EXISTS (SELECT 1 FROM ProductionControl WHERE IRN IN (SELECT...
September 21, 2005 at 1:41 am
Note that #myTemp and ##myTemp are two different tables.
I can't see anything obviously wrong.
I recomend you replace the exec(@sql) with print @sql to see exactly what the server's going...
September 16, 2005 at 3:13 am
It's hardly undocumented. If you look through the articles on 64-bit SQL (on the MS site) it's quite clear that most of the tools don't have a 64-bit version. The...
September 14, 2005 at 2:27 am
Yup. I've got a massive cascade structure in my db. A parent table cascades to 8 child tables, each of which cascades to two more.
I had no joy with indexes,...
September 9, 2005 at 4:09 am
In this case, since you don't need to return a value, you can concat the string together and exec it.
SET @sql = 'Update ' + @tbl + ' Set .........
EXEC...
September 8, 2005 at 12:03 am
Glad to be of some assistance. I'm from South Africa
September 7, 2005 at 5:13 am
Viewing 15 posts - 49,411 through 49,425 (of 49,571 total)