Showing posts with label tsql. Show all posts
Showing posts with label tsql. Show all posts

Tuesday, March 27, 2012

Encryption SQL 2005

I have a desire to encrypt an entire database rather than utilizing TSQL to encrypt individual columns. Outside the SQL Server authentication and access should function as normal.

Reason: avoid customization and change to a vendor applicaiton, and satisfying the group security ghouls by being able to state definatively that the data within the database is encrypted.

The database is small as it contains only financial statement data, so performance should not be an issue.

You may gain some insight from this post:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1784536&SiteID=1

Wednesday, March 21, 2012

Encrypting Data using TSQL

I need to find a way of encrypting and decrypting data from SQL server 2000. I need to do this as transparently as possible, which is why I need to do this if at all possible before my web application encounters the data.

I know this is possible without 3rd party applications using SQL server 2005, as I have a working implementation already; however I need to do this with SQL server 2000 as upgrading is not an option. Using a 3rd party product to encrypt/decrypt is also not possible.

Any help much appreciated.

Matt Rose

You can write a stored procedure on your own,either as a extended stored procedure or you make a call to a COM object. Both options are not very niuce, compared to buying a thrid party products which was extensivly tested. Furtherone you could do this in your business logic, but as you don′t want to interfer with the curretn architecture, I guess this is not an option for you.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

What is the difference between a 3rd party product and writing something homegrown? (it's not necessarily cheaper to 'do it yourself' everytime)

Here's something that seems to do what you need - http://www.xpcrypt.com/ - though I haven't used it so I can't say if it's good or not.

/Kenneth

|||

Thanks for the suggestions. Unfortunately, I do have to do this myself because I've been told that there is no money available for a third party product.

No worries, I've found a solution to the problem from within the web application I was writing; the encryption and decryption is done by the application using a class library.

Thanks

Matt Rose

Wednesday, March 7, 2012

Encounter Error when FTP get file using tsql

Hi,
I have tried to create my procedure by cut and paste the sample FTP get file
using tsql from Author Nigel Rivett (
http://www.nigelrivett.net/FTP/s_ftp_GetFile.html).
When I tried to execute it by passing parameter as below:
exec s_ftp_GetFile
@.FTPServer = 'www.mysite.com' ,
@.FTPUser = 'mysite' ,
@.FTPPWD = 'xxxxxxx' ,
@.FTPPath = '' ,
@.FTPFileName = 'chat.asp' ,
@.SourcePath = 'D:\wwwusr\mysite\web' ,
@.SourceFile = 'chat.asp' ,
@.workdir = 'c:\Temp'
I encounter error ouput as below
1 User (mysite.comnone)): open www.mysite.com
2 Error opening local file D:\wwwusr\mysite\web\chat.asp.
3 NULL
4 NULL
5 NULL
6 get chat.asp D:\wwwusr\mysite\web\chat.asp
7 quit
8 > D:\wwwusr\mysite\web\chat.asp:Permission denied
9 NULL
Please advise...
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...tivity/200608/1Hi, Thank for all the reply..my problem solved, is due to wrong parameter
passing.
exec s_ftp_GetFile
@.FTPServer = 'www.mysite.com' ,
@.FTPUser = 'mysite' ,
@.FTPPWD = 'xxxxxxx' ,
@.FTPPath = '' , --Should specify the file directoty at Remote Server
@.FTPFileName = 'chat.asp' ,
@.SourcePath = 'C:\myftpfile', -- The source path should be the path the fil
e
will be stored in our local machine
@.SourceFile = 'chat.asp' ,
@.workdir = 'c:\Temp'
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...tivity/200608/1

Sunday, February 26, 2012

Enabling Mixed Mode Auth. with tSQL?

Is it possible to run a tSql statement that will enable Mixed-Mode authentication? My customers need to have this set and I don't want them to have to go into Enterprise Mgr. Any ideas?
Thanks!I'm not aware of any way. You may want to run a profiler trace and then do it through enterprise manager to see what command sit executes.

Just an idea...|||Valid tip by Loach, but that does include reading thru registry keys which is not advisable to deal with a code.
YOu're better of with GUI supplied tools.|||Originally posted by riceman744
Is it possible to run a tSql statement that will enable Mixed-Mode authentication? My customers need to have this set and I don't want them to have to go into Enterprise Mgr. Any ideas?

Thanks!

Hello,
you can change security model this way

begin
DECLARE @.hr int
DECLARE @.sqlserver int
declare @.hresult int
DECLARE @.IntegratedSecutiry int
declare @.hostname varchar(255)

declare @.servername varchar(255) set @.servername = @.@.servername

EXEC @.hr = master.dbo.sp_OACreate 'SQLDMO.SQLServer', @.sqlserver OUTPUT
IF @.hr = 0
PRINT 'Ok'
ELSE
EXEC sp_OAGetErrorInfo @.sqlserver

EXEC @.hr = master.dbo.sp_OASetProperty @.sqlserver, 'LoginSecure', 'TRUE'
IF @.hr = 0
PRINT 'Ok'
ELSE
EXEC sp_OAGetErrorInfo @.sqlserver


exec @.hr = sp_OAMethod @.sqlserver, 'Connect', NULL, @.servername
IF @.hr = 0
PRINT 'Ok'
ELSE
EXEC sp_OAGetErrorInfo @.sqlserver

EXEC @.hr = master.dbo.sp_OAGetProperty @.sqlserver, 'IntegratedSecurity', @.IntegratedSecutiry OUTPUT
IF @.hr = 0
PRINT 'Ok'
ELSE
EXEC sp_OAGetErrorInfo @.sqlserver


EXEC @.hr = master.dbo.sp_OASetProperty @.IntegratedSecutiry, 'SecurityMode', '2'
IF @.hr = 0
PRINT 'Ok'
ELSE
EXEC sp_OAGetErrorInfo @.sqlserver


EXEC @.hr = master.dbo.sp_OAGetProperty @.IntegratedSecutiry, 'SecurityMode'--, @.IntegratedSecutiry OUTPUT
IF @.hr = 0
PRINT 'Ok'
ELSE
EXEC sp_OAGetErrorInfo @.sqlserver

EXEC @.hr = master.dbo.sp_OADestroy @.sqlserver
end
GO

by
Paan-cha|||You can do it by modifying the registry.
For default instance
HKLM/Software/Microsoft/MSSQLServer/MSSQLServer/LoginMode

= 1 integrated security, 2 mixed.

But you probably don't want them to do that either.|||If you want to go that route then how about:

declare @.IntValue int
exec xp_regread 'HKEY_LOCAL_MACHINE','Software\Microsoft\MSSQLServ er\MSSQLServer','LoginMode',@.IntValue OUTPUT
select @.IntValue as LoginMode

exec xp_regwrite 'HKEY_LOCAL_MACHINE','Software\Microsoft\MSSQLServ er\MSSQLServer','LoginMode','REG_DWORD',1

exec xp_regread 'HKEY_LOCAL_MACHINE','Software\Microsoft\MSSQLServ er\MSSQLServer','LoginMode',@.IntValue OUTPUT
select @.IntValue as LoginMode

Friday, February 24, 2012

enable/disable Extende Stored Procedure in MSSQL2005

Hi,

Anybody now how to this programmaticly ? in registry or TSQL statement ?

Have you looked at the Surface Area Configuration tools - the feature configuration controls? That section allows you to disable buckets of XPs that are used by a feature you don't use, but you cannot deactivate only individual XPs in a bucket.

Thanks

Laurentiu

|||

if you refer only at running xp_cmdshell , i quote from Books Online

" Introduced in SQL Server 2005, the xp_cmdshell option is a server configuration option that enables system administrators to control whether the xp_cmdshell extended stored procedure can be executed on a system. By default, the xp_cmdshell option is disabled on new installations and can be enabled by using the Surface Area Configuration tool or by running the sp_configure "

for others xp's i didn't find anything