I know this is probably a DOS question but does anyone know how the following would work without taking out the spaces in the folder "Audit Tax Planning\" (works fine in paths without spaces)?
Declare @.ren varchar(255)
Declare @.path varchar(100)
Set @.path = '\\main\WGDATA\Accounting\Audit Tax Planning\' --G:\Accounting\Audit Tax Planning\05BE
IF EXISTS(SELECT id FROM tempdb..sysobjects WHERE id = object_ID('tempdb..#Tax_File'))
DROP TABLE #Tax_File
CREATE TABLE [#Tax_File](
[File_Name] varchar(50),
)
Set @.ren = 'dir /B ' + @.path + 'test.txt'
Insert into #Tax_File ([File_Name])
EXEC master..xp_cmdshell @.ren
If not exists(select [File_Name]
from #Tax_File
where right([File_Name],4) = '.txt')
begin
RAISERROR ('File does not exist.', 16, 1)
Return
end
select * from #Tax_FileSure, you need quotes
Read here
http://weblogs.sqlteam.com/brettk/archive/2005/06/28/6895.aspx|||Yup, the quotes inside work, thank you.
Showing posts with label audit. Show all posts
Showing posts with label audit. Show all posts
Tuesday, March 20, 2012
Saturday, February 25, 2012
Password Audit
Hello All,
I am in the process of auditing a SQL server and was checking for NULL
passwords. I ran the following query select name, password from
master..sysxlogins where password is NULL.
It returned the expected windows accounts with NULL passwords, but it also
returned two unknown accounts with NULL for the SID, Name, and Password, and
a status of 192.
Has anyone ever seen this before, and if so, what they might be?
Thanks
DanHi,
Have you tried with C2 Audit ? Password Audit from www.sqlsecurity.com ?
:-)
Regards
--
Andy Davis
Activecrypt Team
---
SQL Server Encryption Software
http://www.activecrypt.com
I am in the process of auditing a SQL server and was checking for NULL
passwords. I ran the following query select name, password from
master..sysxlogins where password is NULL.
It returned the expected windows accounts with NULL passwords, but it also
returned two unknown accounts with NULL for the SID, Name, and Password, and
a status of 192.
Has anyone ever seen this before, and if so, what they might be?
Thanks
DanHi,
Have you tried with C2 Audit ? Password Audit from www.sqlsecurity.com ?
:-)
Regards
--
Andy Davis
Activecrypt Team
---
SQL Server Encryption Software
http://www.activecrypt.com
Subscribe to:
Comments (Atom)