Viewing 15 posts - 2,431 through 2,445 (of 5,393 total)
You could use the builtin SQLAgent roles and deny EXECUTE on msdb.dbo.sp_add_job
-- Gianluca Sartori
October 24, 2011 at 1:53 am
Ouch! I didn't think it had to run on SQL 2000. Sorry about that.
If you remove the FOR XML PATH thing you can generate the scripts and run manually.
Good luck!
-- Gianluca Sartori
October 18, 2011 at 2:09 am
Other two (slower) methods:
-- UNPIVOT + ROW NUMBER on the "2nd dimension"
SELECT id, col
FROM (
SELECT *, ROW_NUMBER() OVER ( PARTITION BY id ORDER BY value) AS RN
FROM #Tab1
UNPIVOT (...
-- Gianluca Sartori
October 17, 2011 at 3:01 am
Another (slower) method:
SELECT id, col = CASE WHEN v1 <= ALL (SELECT v FROM ( VALUES (v2), (v3), (v4), (v5), (v6)) AS src (v))
...
-- Gianluca Sartori
October 17, 2011 at 2:37 am
Cadavre (10/17/2011)
Gianluca Sartori (10/14/2011)
I couldn't resist!Me either 😀
I already knew it was slow, but it was such a fun problem!
It's something you don't stumble upon very often.
-- Gianluca Sartori
October 17, 2011 at 2:18 am
I'm perfectly aware that Lowell provided a nice lightning-fast solution, but...
I couldn't resist!
SELECT id, col = (
SELECT col
FROM (
...
-- Gianluca Sartori
October 14, 2011 at 10:30 am
sqlcmd -h -1 -S sqltest01gdfuk\test -d master -E -Q "SET NOCOUNT ON; exec dbo.SQLDBState_Proc.prc" -v myVar="%arg1%"
Drop ".prc", it's not part of the procedure name:
sqlcmd -h -1 -S...
-- Gianluca Sartori
October 14, 2011 at 7:42 am
jjunkjjunk (10/14/2011)
Hi I managed to create the procedure in master databasein dbo." " schema
I advise against that. You don't need to and,...
-- Gianluca Sartori
October 14, 2011 at 7:39 am
October 14, 2011 at 3:49 am
jjunkjjunk (10/14/2011)
Apparently the sql procedure was only complaining because it didn't like"use master
go"
in the procedure.
That was the reason, as I explained in my previous reply.
I've created the procedure via new...
-- Gianluca Sartori
October 14, 2011 at 3:24 am
Glad you sorted it out.
-- Gianluca Sartori
October 14, 2011 at 2:32 am
WebTechie38 (10/13/2011)
Gianluca,Thanks for the response. Looks interesting.
Now what is a spaghetti DBA?
Tony
It's me! 🙂
That's the name I gave to my blog.
-- Gianluca Sartori
October 14, 2011 at 2:29 am
First of all, I would not use a stored procedure at all.
The procedure wuold have to be created in master, but it's not a good practice. Leave the system...
-- Gianluca Sartori
October 14, 2011 at 2:27 am
You're welcome, glad I could help.
Honestly, I have never tried to use FMTONLY ON to test the output, but I guess it could work.
Yes, changing the procedure to return...
-- Gianluca Sartori
October 14, 2011 at 1:45 am
External applications generally invoke the procedure and determine the result sets shape from metadata.
You can use a "dirty trick" to achieve the same thing:
DECLARE @srv nvarchar(4000)
SET @srv = @@SERVERNAME --...
-- Gianluca Sartori
October 13, 2011 at 8:06 am
Viewing 15 posts - 2,431 through 2,445 (of 5,393 total)