Scary stuff...
-
when you're the new DBA and find code snippets like this one...
Part of a procedure to determine disk space usage:
<FONT color=#0000ff>WHILE @@FETCH_STATUS = 0 BEGIN</FONT><FONT color=#0000ff> SET @DOSCmd = <FONT color=#800080>'chkdsk</FONT> ' + @Drive + ':'
INSERT INTO #ChkDsk
EXEC master.dbo.xp_cmdshell @DOSCmd</FONT><FONT color=#0000ff> SELECT * from #ChkDsk</FONT>
Running chkdsk on a LIVE PRODUCTION SERVER(s) to determine disk usage...OMG! [B)]
-
Eww.... surely the wtf is that people code in a language that looks like the bastard son of cobol and bash.
(so speaks a perl coder...)
-
What would this do:
SET @DOSCmd = 'format ' + @Drive + ': /Q'
That way you can maximize the amount of free disk space!
-
@Manni said:
What would this do:
SET @DOSCmd = 'format ' + @Drive + ': /Q'
That way you can maximize the amount of free disk space!
You forgot /X to force dismount
-
@masklinn said:
@Manni said:
What would this do:
SET @DOSCmd = 'format ' + @Drive + ': /Q'
That way you can maximize the amount of free disk space!
You forgot /X to force dismount
I see you've done this before. ;)