Showing posts with label creating. Show all posts
Showing posts with label creating. Show all posts

Tuesday, March 27, 2012

Encryption of SQL Queries

Hi.

I am running SQL select queries over a network from a SQL Server to a mySQL server by creating a linked server.

I need data to be encrypted (nothing heavy), but some form of encryption over the network as it exits the firewall.

Any help appreciated.

Karloi'm no expert with sql server. but i am pritty good with using Windows networking. i think in this case you might wanna check out IPSec deployment. it would be the most secure option. the Windows 2003 site has alot of docs on ipsec. also to some extent i think ssl might work too but i'm not sure|||

Karlo S wrote:

Hi.

I am running SQL select queries over a network from a SQL Server to a mySQL server by creating a linked server.

I need data to be encrypted (nothing heavy), but some form of encryption over the network as it exits the firewall.

Any help appreciated.

Karlo


Natively with SQL you can utilise certificates to achieve this, or indeed IPSec if your mySQL server supports it, and if both servers were SQL 2005 MS might suggest using HTTP endpoints.
However you mentioned firewalls, and I would recommend that you implement a firewall to firewall VPN between your network and the destination network containing the mySQL. This simpifies things greatly, and requires no config on either database server.

Encryption of SQL Queries

Hi.

I am running SQL select queries over a network from a SQL Server to a mySQL server by creating a linked server.

I need data to be encrypted (nothing heavy), but some form of encryption over the network as it exits the firewall.

Any help appreciated.

Karloi'm no expert with sql server. but i am pritty good with using Windows networking. i think in this case you might wanna check out IPSec deployment. it would be the most secure option. the Windows 2003 site has alot of docs on ipsec. also to some extent i think ssl might work too but i'm not sure|||

Karlo S wrote:

Hi.

I am running SQL select queries over a network from a SQL Server to a mySQL server by creating a linked server.

I need data to be encrypted (nothing heavy), but some form of encryption over the network as it exits the firewall.

Any help appreciated.

Karlo


Natively with SQL you can utilise certificates to achieve this, or indeed IPSec if your mySQL server supports it, and if both servers were SQL 2005 MS might suggest using HTTP endpoints.
However you mentioned firewalls, and I would recommend that you implement a firewall to firewall VPN between your network and the destination network containing the mySQL. This simpifies things greatly, and requires no config on either database server.sql

Monday, March 26, 2012

Encryption for sql server

hey ppl..
i am creating a client that can access straight into the sql db using vb.net.
is there a way encrypt the data from the client and the sql server will decrypt the data and visa versa?Your best choice is to use some flavor of VPN to get your data to the server safely. A poor alternative (although pure MS-SQL) is to use Named Pipes, which can do feeble encryption at relatively low performance.

-PatP|||is there anyway to make a simple encryption? small enough so that it encrypts the data and it does not effect performance?|||See if this helps you:

http://www.developerfusion.com/show/4647/

You would basically be storing the data encrypted. The problem is when you go to search the data of course. If you need to encrypt all traffic, you can look at what Pat said. I would recommend against it. There are also several hardward level tools for this, but they are expensive.

Monday, March 19, 2012

Encrypting a data

Hi,

I have creating a stored procedure in sql server 2005 to encrypt a parameter value that comes from an asp.net page. this value is of type varchar.

Now i have declared a paramater as varbinary to accept this value in the stored procedure. And encrypting it using symmetric key which is encrypted by certificate.

Now when i enter a value into the textbox in asp.net page. it shows

"implicit conversion from varchar to varbinary not possible" pls tell me what is the solution? do i have to convert the value in vb code while accessing the value of the textbox or do i have to convert the value while passing the value when call stored procedure.

pls tell me the solution so that i don't jave to change any coding in vb.

some solution in sql server itselt.

Thank you

Gaurav

If you're passing a varchar to the stored procedure, then rewrite the stored procedure to accept a varchar.

Thanks
Laurentiu

|||

But i have to encrypt that value - the value that is coming from a varchar parameter.

And encryption works on varbinary data type. so do i need to convert that parameter to varbinary in the stored procedure.

Infact i even tried that but it is showing the same result implicit conversion not allowed.

Pls give me a solution. where i could pass a varchar data type value to a stored procedure and encrypt it in the stored procdure.

Thanks

Gaurav

|||

You can encrypt varchar values; it is not true that encryption works only on varbinary data. See the BOL article for EncryptByKey:

http://msdn2.microsoft.com/en-us/library/ms174361(SQL.90).aspx

varchar is explicitly listed as an accepted type for the cleartext data, so you just need to rewrite your procedure to accept a varchar value. Converting the varchar data to varbinary in the procedure does not help, because the problem happens earlier when you pass the varchar value to the procedure that expects a varbinary. If you don't want to change the procedure code to expect a varchar, then you have to explicitly cast the varchar to varbinary before you pass it to the procedure.

For an example that encrypts varchar data, see http://blogs.msdn.com/lcris/archive/2005/12/16/504692.aspx. There are other examples on my blog that encrypt varchar data besides that one.

Thanks
Laurentiu

Sunday, February 19, 2012

enable ansi_nulls on existing table

Is there any way to enable ansi nulls on an existing table w/o
droppping/creating?
thanks
jimthis is set at the database level. however, this setting is overwritten by
connection/session setting every time.
to change the affect on an object, you will need to recreate the object.
--
-oj
"Jims" <biz@.neocasa.net> wrote in message
news:OXA92akiGHA.1508@.TK2MSFTNGP04.phx.gbl...
> Is there any way to enable ansi nulls on an existing table w/o
> droppping/creating?
> thanks
> jim
>

Friday, February 17, 2012

Empty table problem

I am creating three tables in a DataSet using three stored procedures and I need a way to know that either the tables have at least one row or preferably which if any has no rows. How can I do that?

using three SP's, one for each table:

SqlCommand cmd =newSqlCommand("CompanyCheck", con);
SqlCommand cmd2 =newSqlCommand("ContractorVerify", con);
SqlCommand cmd3 =newSqlCommand("StoreLocation", con);

cmd.CommandType = CommandType.StoredProcedure;
cmd2.CommandType = CommandType.StoredProcedure;
cmd3.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@.CompanyID", CompanyID);
cmd2.Parameters.AddWithValue("@.CompanyID", CompanyID);
cmd3.Parameters.AddWithValue("@.CompanyID", CompanyID);
SqlDataAdapter da = new SqlDataAdapter();

da.SelectCommand = cmd;
DataSet ds = new DataSet();
try
{
da.Fill(ds, "CompanyInfo");
da.SelectCommand = cmd2;
da.Fill(ds, "ContractorInfo");
da.SelectCommand = cmd3;
da.Fill(ds, "StoreInfo");
}
catch
{ throw new ApplicationException("Data error"); }
finally
{
con.Close();
}

Thank you

Zoltac,

I would try

if (ds.Tables.Count == 3)
{
if(ds.Tables[0].Rows.Count > 0)
{ }
if(ds.Tables[1].Rows.Count > 0)
{ }
if(ds.Tables[2].Rows.Count > 0)
{ }

Is this what you are looking for? If not, I might be misunderstanding your question.

|||

Thank you - Exactly what I was looking for - maybe one of these days I will finally get it. I need a big wall chart with all the properties and methods, etc,, etc. and maybe then I will have a clue as to what Net 2.0. is made up from. appreciate the quick response.