Viewing 15 posts - 31 through 45 (of 61 total)
Please check this code:
-- Session 1
declare
@from_id int = 0
,@to_id int = 0
,@rowcnt int = -1
create table ##tmp_move_date (id int primary key, from_id int, rowcnt int)
insert into ##tmp_move_date (id,...
February 22, 2013 at 6:47 am
If the created_date and modify date are not nullable, then please check this code.
create procedure usp_switch_data
@create_date datetime = null
,@modify_date datetime = null
as
if @create_date is not null or @modify_date is...
February 22, 2013 at 2:42 am
Thanks for replay!
I'm using the profiler with this settings (Picture_1.png).
Now I'm catching all request what runing from MyDatabase, but I don't catch those requests what MyDatabase is received.
Exapmle:
I catch:
Use [MyDatabase]
GO
--...
August 23, 2012 at 1:31 am
Sorry, I said wrongly.
I want to catch all request witch refer to my database.
These requests from another database:
select * from mydatabase.schema.tables
execute mydatabase.schema.procedures
etc,
These requests from my database:
All request
Thanks
August 22, 2012 at 11:08 am
I don't know the query is how come. (Another database, linked server, etc).
My aim catch all query in the database.
August 22, 2012 at 9:06 am
I think you can include "dbid" column on profiler - it should tell you from where the query is being executed.
I don't know what database is runing the query (This...
August 22, 2012 at 9:02 am
This command sloved my problem:
EXEC sp_removedbreplication
Thanks!
August 12, 2012 at 2:12 pm
My task is done, with this idea:
1.) Using lock_timeout on the session
2.) Search object with sp_lock stored procedure
If the object is not locked, then alter...
August 6, 2012 at 11:28 am
Thanks Gail!
The problem is the log_reuse_wait_desc is replication, but this database is not publisher and not subscriber database. Now, how to I shrinking the transaction log?
Thanks!
July 14, 2012 at 10:41 am
Please check this query:
UPDATE t1
SET t1.employeegroupid = t2.employeegroupid
FROM dbo.rollingdutyrostershift t1
INNER JOIN dbo.employeegroupmaptoemployee t2
ON t1.employeeid = t2.employeeid
WHERE t1.employeeid IN (37, 74, 75 etc)
April 15, 2012 at 12:58 am
I can't found only CREATE TABLE role for test_user, but I created this database trigger for my script.
CREATE TRIGGER
DDLTrigger_test_user_deny
ON DATABASE FOR
DROP_TABLE
,ALTER_TABLE
,CREATE_INDEX
,ALTER_INDEX
,DROP_INDEX
,CREATE_PROCEDURE
,ALTER_PROCEDURE
,DROP_PROCEDURE
,CREATE_FUNCTION
,ALTER_FUNCTION
,DROP_FUNCTION
,CREATE_VIEW
,ALTER_VIEW
,DROP_VIEW
,CREATE_TRIGGER
,ALTER_TRIGGER
,DROP_TRIGGER
AS
IF (SELECT SUSER_SNAME()) = 'test_user'
BEGIN
ROLLBACK
PRINT 'You do not...
April 12, 2012 at 1:08 am
Example: http://www.codeproject.com/Articles/28951/SQL-Server-2005-Merge-Replication-Step-by-Step-Pro
March 24, 2012 at 10:19 am
Is this code not a slove?
USE [tempdb]
GO
DECLARE @space_used integer, @db_name NVARCHAR(20)
SELECT TOP 1 @db_name = a.name, @space_used = cast(round(fileproperty(a.name,'SpaceUsed')/128.000,0) + 1 as integer)
FROM dbo.sysfiles a
WHERE a.filename LIKE '%.mdf'
PRINT @space_used
PRINT @db_name
DBCC...
March 12, 2012 at 7:21 am
Viewing 15 posts - 31 through 45 (of 61 total)