Viewing 15 posts - 1,531 through 1,545 (of 5,502 total)
Oh, now I see what you're looking for...
Maybe the following code will do the trick:
;WITH cte AS
(SELECT ROW_NUMBER() OVER(PARTITION BY t1.ActivityControllerID ORDER BY t1.ActivityID) row
FROM @tbl2...
May 22, 2011 at 5:10 am
Try to google or search this site for the difference between COUNT(*) and COUNT(column_name).
May 21, 2011 at 3:44 pm
It's worth to notice that laddu4700 already posted his question in a different thread.
May 21, 2011 at 3:43 pm
Based on the code in the sproc you posted:
This is designed to do the same sort of thing as Access's cascade delete function.
Why don't you add a (referential) foreign key...
May 21, 2011 at 2:27 pm
since SQL Server doesn't know if you'd like insert the value into the ID or name column, you need to specify it:
insert into ID1(ID) values(8)
And no, SQL Server will not...
May 21, 2011 at 2:22 pm
Why don't you use referential integrity together with cascaded delete?
May 21, 2011 at 2:09 pm
Either you provide a value for each column or you need to identify the column(s) you'd like to insert the values.
May 21, 2011 at 2:05 pm
There are numerous tools available to import data such as SSMS, BULK INSERT, OPENROWSET, linked server, SSIS, BCP.
Each one has its own strngth and weaknesses.
Question aside: is this a real-world...
May 21, 2011 at 2:02 pm
One option to add the identity property would be using SSMS (right-click on the table -> design).
"Under the hood" it creates a new table, insert the original data, drop the...
May 21, 2011 at 12:18 pm
In SS2K5 you could use a trigger and insert the the data of the internal tables INSERTED and DELETED into an audit table.
Your view would be based on the 10...
May 21, 2011 at 3:58 am
Here's a short example using LEFT JOIN:
DECLARE @tbl TABLE
(
ID INT IDENTITY (1,1),
ActivityControllerID INT,
ActivityID INT
)
INSERT INTO @tbl
VALUES(4,2),
(4,4),
(4,5),
(4,6),
(8,1),
(8,3),
(8,4),
(8,5),
(8,6),
(8,7)
DECLARE @tbl2 TABLE
(
ActivityControllerID INT,
...
May 21, 2011 at 3:55 am
You could check if your Activation Stored proc is running before processing the next message.
May 21, 2011 at 3:21 am
Try to eliminate the root cause (= the duration of the "long running query"). It might be an option to use the Divide'n'Conquer concept if this is a really complicated...
May 21, 2011 at 3:11 am
What exactly are you trying to achieve?
May 21, 2011 at 2:52 am
You could use NOT EXISTS or a LEFT OUTER JOIN.
The requirement itself is a little unclear since you mention a AcitivityControllerID column that is not part of the result set...
May 21, 2011 at 2:36 am
Viewing 15 posts - 1,531 through 1,545 (of 5,502 total)