Viewing 15 posts - 16 through 30 (of 529 total)
The row that got updated can be found from the INSERTED or DELETED table. Those tables have the same layout as your source table, so if you take the PK-fields...
December 30, 2003 at 3:44 am
A little bit more generic solution would be to build a (temporary) table that holds for each value to replace a pointer to the new record.
CREATE...
December 30, 2003 at 3:38 am
Did you think about using any kind of 'Virtual PC' software? This gives you the possibility to run a complete machine from a DVD (only need the virtual PC software...
December 30, 2003 at 3:23 am
If you got the correct results from 'my' query, you see that the solution you posted is correct. I just added your data and your query to a single script.
Can...
December 18, 2003 at 3:55 am
Yep, in almost all case it is better to write separate triggers.
I can only see the use of one trigger for all actions if you just want to record 'changes'...
December 17, 2003 at 7:17 am
You should clearly make the distinction between a primary key and foreign key. They are in no way related and serve completely different goals ...
A primary key is a way...
December 17, 2003 at 7:12 am
Try executing this, it should return the result as you expect it...
USE Pubs
GO
create table testgroup
(colA int,
colB int,
colC int)
GO
SET nocount on
GO
insert into testgroup values (1,40,0)
insert into testgroup...
December 17, 2003 at 7:04 am
This is very strange. The query you mention should return the result as you describe it, not the result you mention.
Are you really sure about the source data and the...
December 17, 2003 at 7:02 am
Sounds to me like a logical solution for typical one-to-many relationships.
From a technical point of view, you might consider placing a UNIQUE constraint on the child table (instead of the...
December 17, 2003 at 3:46 am
Is it possible that your DB is autogrowing? Check the parameters of your DB. If it is set to autogrow, and your current size is near the maximum, try either...
December 15, 2003 at 7:56 am
Don't think this is possible in SQL.
Can be done in ADO (and the like). If you have an updateable RecordSet object, you can change the values of a row in...
December 11, 2003 at 8:41 am
Try the following code
SELECT t1.product, t1.time_period
FROM <table> t1
WHERE t1.unique_row_id IN
(SELECT TOP 10 t2.unique_row_id
FROM <table> t2
WHERE...
December 10, 2003 at 4:35 am
Something like this...
SELECT ...
FROM ...
WHERE DateDiff(Day, MyDateField, getdate()) <=7
You might need some casting on the MyDateField. Post the exact format of the string if you can't...
November 14, 2003 at 9:59 am
I think you should look at removing all the OR statements. In general, an OR is bad for performance.
Additionally, I would have a look at changing the IN statements in...
November 13, 2003 at 4:09 am
The difference in Collation might explain the difference.
The SQL_Latin1_... collation is a UNICODE collation. The Latin1_General_... is not.
Under the hood, SQL Server is converting everything internally to a double byte...
November 12, 2003 at 8:21 am
Viewing 15 posts - 16 through 30 (of 529 total)