Viewing 15 posts - 4,966 through 4,980 (of 5,393 total)
Short answer:
ALTER PROCEDURE dbo.sp_Status_3
(
@myLocationRef int,
@myReviewerRef int =NULL,
@myBURef int =NULL
)
AS
SELECT *
FROM dbo.tmp_sp_Status_2
WHERE (ReviewerRef = COALESCE(@myReviewerRef,ReviewerRef)) AND (BURef = COALESCE(@myBURef, BURef)) AND (LocationRef = @myLocationRef)
Long answer:
This code works, but it is not...
-- Gianluca Sartori
August 5, 2009 at 6:22 am
Try this:
select *
from sys.dm_tran_locks
where resource_database_id = db_id()
and resource_type = 'OBJECT'
and resource_associated_entity_id = object_id('MyTable')
-- Gianluca Sartori
August 5, 2009 at 4:01 am
Try this:
select e.ecode, ename = e.ename + CASE WHEN counts.cnt > 1 THEN ' ' + e.ecode ELSE '' END
from emp as e
inner join (
select ename, count(*) as cnt
from emp
group...
-- Gianluca Sartori
August 5, 2009 at 3:52 am
Eswin (8/4/2009)
Hi Expertz,Please help me with these posts............
http://www.sqlservercentral.com/Forums/Topic763933-65-1.aspx
http://www.sqlservercentral.com/Forums/Topic754722-65-1.aspx#bm757143
I don't think this is a good behaviour.
I go through all new posts every day and I start from unanswered questions. If I...
-- Gianluca Sartori
August 5, 2009 at 1:33 am
Hi Jeff, thanks for chiming in!
When will the article be online again? It's hard to explain this technique to others without the help of your article... expecially for poor pretenders...
-- Gianluca Sartori
August 5, 2009 at 1:15 am
You could use the famous "quirky update" algorithm by Jeff Moden.
It is described in an article that is currently under construction. I hope it will be soon fixed. The link...
-- Gianluca Sartori
August 4, 2009 at 9:21 am
Bob Hovious (8/4/2009)
I don't think he was comparing apples to apples.
No, he got confused by sp_spaceUsed.
It really is interesting anyway.
Saving XML in tables and treating it as if it...
-- Gianluca Sartori
August 4, 2009 at 8:31 am
I also suggest not to use cursors: they're slow.
There's almost nothing that can't be done without cursors.
-- Gianluca Sartori
August 4, 2009 at 8:24 am
SET @RESULT= @RESULT + @RECEIVE - @PAY
-- Gianluca Sartori
August 4, 2009 at 8:22 am
You could add a parameter to uspGetError to pass the procedure name (OBJECT_NAME(@@procid)).
-- Gianluca Sartori
August 4, 2009 at 8:17 am
You have to open the DTS package from the Enterprise Manager.
Right click Data Transformation Services and choose "Open Package". Pick the file from the dialog and choose open.
You can now...
-- Gianluca Sartori
August 4, 2009 at 7:58 am
Hi, it's not clear to me what you are trying to achieve.
I'm posting the sample data so other users can test solutions.
DECLARE @table TABLE (
item int,
Sales_date datetime,
Quantity int,...
-- Gianluca Sartori
August 4, 2009 at 7:54 am
Nice article, I learned something about XML in SQL Server today.
As Paul pointed out, it's impossible that XML storage needs less space than conventional storage.
With appropriate indexing, there's no way...
-- Gianluca Sartori
August 4, 2009 at 5:53 am
You could also get the full SQL command that fired the trigger:
SELECT text
FROM sys.dm_exec_requests
CROSS APPLY sys.fn_get_sql(sql_handle)
But I don't know if this fits your needs.
-- Gianluca Sartori
July 31, 2009 at 10:13 am
I guess the problem is trigger_events: it contains every event that makes the trigger fire, not the event that fired the trigger NOW.
You could guess the operation type looking at...
-- Gianluca Sartori
July 31, 2009 at 10:09 am
Viewing 15 posts - 4,966 through 4,980 (of 5,393 total)