Showing posts with label native. Show all posts
Showing posts with label native. Show all posts

Sunday, March 25, 2012

Data encryption in SQL Server 2000

I know there is no native encryption in SQL2K, but what 3rd party encryption tools would other forum members recommend from experience? I am required to encrypt data for PCI compliance.
Thanks
LempsterSQL Server Magazine (http://www.sqlmag.com/articles/index.cfm?articleid=44550&) gives you a few good hints, even if you don't subscribe. Apart from that, I do not know what kind of requirements you have, but keep in mind that NTFS supports encryption of files, which is transparent to the applications, so you can encrypt the data files so that only the SQL Server Service Account can read the file. Hope this was of some help.

Friday, February 24, 2012

Darn Slashes!!!

04/18/2007 11:34:31
(37000/102), [Microsoft][SQL Native Client][SQL Server]Incorrect syntax near '\'.

DECLARE @.curdate DATETIME
SET @.curdate = GETDATE()
Insert into OPTION (ID, NUM, VAR, VALUE, DATE_MODIFIED, USER_MODIFIED, READ_ONLY)
SELECT distinct ID, NUM, 'stack', 'S', @.curdate, 'ADMIN', '1'
FROM OPTION
WHERE VAR='option' and FLOOR(FL_VALUE\POWER(2,3))%2=1

The piece of code above works in a sql server management studio query window but does not work through ODBC. Can someone help me in the syntax for this \

It seems to recognize / but not \

Thanks

Maybe change this line:

WHERE VAR='option' and FLOOR(FL_VALUE\POWER(2,3))%2=1

to this:

WHERE VAR='option' and FLOOR(FL_VALUE/POWER(2,3))%2=1

I guess the short answer to your question is that '/' and '\' are not recognized as the same operator.

|||

I apologize I had it backwards. The line is setup up like you change

WHERE VAR='option' and FLOOR(FL_VALUE/POWER(2,3))%2=1;

The error completely ignores is: Ive tried to use different symbols such as \/ or //

Nothing seems to work

|||

Please explain what you are attempting to do...

What is not working?

|||

It works when run directly from management studio. Im trying to insert a new record into the same table based on whether the 3rd bit is set in the VALUE column. The syntax is correct. However, when I run this through ODBC the error is:

VALUEPOWER is not a recognized built-in function name.

Somehow ODBC is ignoring the /

There has to be some way to make it understand

|||It is not ODBC, it is the programming language you are using. What did you write the code in? Post your actual code.

|||Also, why not to use much more simple way:

WHERE VAR='option' and FL_VALUE & POWER(2,3) > 0

The only restriction I remember is that FL_Value has to be of integer type (tinyint, smallint, or int). Anyway, you can always use cast() if need be...
|||

Buddy give the complete code & language which you are using...

If you provide which ODBC/provider component using on your code should make sense..

I am really surprised how WHERE VAR='option' and FL_VALUE & POWER(2,3) > 0 will replace the WHERE VAR='option' and FLOOR(FL_VALUE/POWER(2,3))%2=1

|||Author says "whether the 3rd bit is set" - my code is doing just the same, but in a more straight manner.
Also, I doubt it's the problem in the ODBC driver or provider or whatever. Instead, I prefer to look into the client code where this query is constructed - the error may reside there, as well...