Monday, May 20, 2013

[SQL Server] user to run server agent job from their client pc

[SQL Server] user to run server agent job from their client pc


user to run server agent job from their client pc

Posted: 20 May 2013 01:27 PM PDT

how do i setup a user on a windows 7 client pc to run a sql server agent job on sql server 2008 on demand?

SIGN

Posted: 20 May 2013 07:56 AM PDT

Why does this return more then one row? The book I'm reading doesn't say why and I'm used to select top meaning it will only select that many rows.SELECT mth,qty, SIGN(S1.qty - (SELECT TOP (1) qty FROM dbo.Sales AS S2 WHERE S2.mth < S1.mth ORDER BY S2.mth DESC)) AS sgn FROM dbo.Sales AS S1 GOIf you need to test this is the table I'm running against.USE tempdbGOCREATE TABLE dbo.Sales(mth DATE NOT NULL PRIMARY KEY, qty INT NOT NULL) INSERT INTO dbo.Sales(mth,qty) VALUES ('20071201',100), ('20080101',110), ('20080201',120), ('20080301',130), ('20080401',140), ('20080501',140), ('20080601',130), ('20080701',120), ('20080801',110), ('20080901',100), ('20081001',110), ('20081101',100), ('20081201',120), ('20090101',130), ('20090201',110), ('20090301',120), ('20090401',120), ('20090501',130), ('20090601',130), ('20090701',100), ('20090801',110), ('20090901',140), ('20091001',100), ('20091101',110), ('20091201',120)Thanks....

Problem with truncate not releasing exclusive access

Posted: 20 May 2013 08:26 AM PDT

I am truncating several tables using a SQL script. The script runs successfully. The next thing I do is a restore to the DB using either the Management Studio or a restore script. (I'm restoring from a production DB backup). In either case, I get an error on restore "Exclusive access could not be obtained because the database is in use."It appears that the truncate still has exclusive access.Am I forgetting to do something as part of the truncate?I am running all commands as sa (which is the db_owner)Example:use MyTestDBtruncate table dbo.my_employee_list;gotruncate table dbo.my_employee_pay;gothank you in advance for your help

SQL Version on Production Server

Posted: 19 May 2013 08:57 PM PDT

Out of curiosity - what it the version of SQL that is being used in the real world ?

No comments:

Post a Comment

Search This Blog