I've just received a question from my boss to encrypt an entire table, stored in SQL Server 2012.
The problem is that, in this table, we store some personal information that not even the database administrator has to see. We have also several application which work with the data in this table, so I will appreciate if there is a method to hide the data both with ODBC access and with SQL Query Access via SQL Server Management Studio, without changing these applications.
Can anyone tells me the solution?
Thank you very much
If you want to restrict access to certain columns only you can use column level security and grant access only to those columns. Considering you have a group called ODBCAPPS it would looks something like this:
GRANT SELECT ON dbo.Employee (EmployeeID, FirstName, MiddleName, SurName) TO ODBCAPPS;
More details about GRANT you can find on MSDN
You can do something with ASCII
UPDATE Table_name
SET x=ASCII(x)+3, y=ASCII(Y)+3 // Choose your number. This is the simplest
For more refer :https://learn.microsoft.com/en-us/sql/t-sql/functions/ascii-transact-sql
Related
I am working in a company that has software that can connect to a database and push values to a table.
I have a problem that some properties do not insert into the database.
I check regular insert query in the SQL Server Management Studio, and the insert is ok there.
I want to check the values that came from my software company before insert to the table.
Friends, please help me.
Thanks
You can use extended events(light weight version of profiler).You may choose filters as per your requirement and in set session filters screen you can try scoping to a single database or a table or even some text using like syntax
Below are the steps
I am working on a project that requires me to read/write to an OLEDB. I do not know what table the information I'm looking for is in and there are about 150+ tables. Is there a way to search each table for a certain column header without querying each table one by one? so far I've just been doing
SELECT * FROM [name]..[name].[name] GO
And reading the headers in data grid view on a vb.net program I made.
Try this if you have a user with dba privileges on the Oracle database.
SELECT OWNER, TABLE_NAME,COLUMN_NAME
FROM sys.dba_tab_columns
WHERE column_name LIKE UPPER('%Your column name%');
Is there a way to list table and column names where I am not granted access? I am a developer trying to access and see if a column name is available but dba's are restricting any sort of read 'select' access. This is for SQL Server 2008. Thanks.
It would be best to open up communications with your DBA for this issue. Technically speaking there is a way to do this however the DBA is likely the only one that can provide this information. Which asking what you have permissions to is not an unreasonable request in my eyes (as a DBA).
You might also suggest that in place of you having to ask them these types of questions over and over if they can grant you VIEW DEFINITION on the particular database. This grants you metadata access to objects in the database without granting access to the objects themselves.
No, there isn't. The SQL Server will not expose any metadata on objects you dont have a privilege to use. So, if you don't have a SELECT permission on a table, you won't see it's metadata. Same with stored procedures etc.
Try this:
select * from INFORMATION_SCHEMA.TABLES
select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='<name>'
Not sure if the DBA's restricted access to these views or not
I am trying to give users different grants into a database. I Know how to do this graphically in SQL Server 2008, but how can I do this with SQL code.
I know to do this for a table for example
GRANT SELECT, INSERT, UPDATE ON dbo.YourTable TO YourUserName
But how to make this not only for one table but for the entire DB.
I have tried it like above with the name of database , but it does not function....How can I do this? Please help me?
If you know how to do it graphically (I assume you mean with SSMS or another tool), than turn on the SQL Profiler and capture the TSQL statements that SSMS emits when it does it - you can learn exactly how to do any such task.
We're trying to pinpoint the source of some unexpected updates happening on a SQL Server table. What I'd like to do is create a trigger on that table monitoring that column we're interested in, and when updates occur, write some audit info into a separate table.
Works great and fine for things like user name, date, old and new columns values (from the Inserted and Deleted trigger tables) - but I'd like more :-)
In SQL Profiler, you can see the name of the app that's connected to SQL Server in the profiles - the part that can be defined in the connection string as Application Name:
Data Source=(local);Initial Catalog=AdventureWorks;
Integrated Security=True;Application Name="My Application"
Is there any way in a T-SQL FOR UPDATE trigger to get at this information?
SELECT APP_NAME()
Marc_S the sP_whoIsActive stored Procedure probably will solve Your problems
as posted here
and it's awesome part of T-SQL by the way
Not sure but could you possibly log the server name if you applications are on multiple servers? It might help narrow down the list of applications.