0
votes
0answers
33 views

Table Field to Reference Field in Other Tables

Suppose I want to map a set of input values to database table fields E.g. employeeFirstName --> emp.fName employeeLastName --> emp.lName ... --> ... In theory I can create a ...
4
votes
2answers
192 views

Is there a quick way to find all columns in SQL Server 2008 R2 that are encrypted/have encrypted data?

Is there a quick way to find all columns in SQL Server 2008 R2 that are encrypted/have encrypted data? I need to nullify the data in all encrypted columns in a development server (according to our ...
3
votes
3answers
2k views

How can I search the full text of a stored procedure for a value?

I use the following script to search the text of all stored procedures when I want to find specific values. SELECT ROUTINE_NAME, ROUTINE_TYPE FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_DEFINITION ...
4
votes
1answer
2k views

Deny access to information schema in SQL Server

I am looking for the best way to disable access to the sys.tables / Information Schema for a user / group in SQL Server. I found this thread from 2008 It shows a way how to deny access on ...
2
votes
1answer
179 views

Schema for 1 <-> 0..1(+), many related but only one primary

Using tools available in SQL Server 2008 and Entity Framework, what is a solid way to represent a one-to-many relationship, where there is an underlying unique relation that I need to enforce? My ...
3
votes
1answer
681 views

How do I merge two XML variables in SQL Server (2005/2008)?

Forward: I've already read this StackOverflow thread and it does not address the depth retention I need. I want to create an XML document that contains the data definition objects for a single ...
4
votes
2answers
899 views

Using the correct database when calling a system stored procedure in SQL Server 2008

I think there's something I'm missing when it comes to which database is being used when running a custom system stored procedure. I have the following in my stored procedure (edited for brevity): ...
1
vote
1answer
396 views

SQL query to INFORMATION_SCHEMA.TABLES to only return those I have select access to

I currently have a query in SQL 2008 that can return me a list of tables for a given database, provided I have View Definition access to them. select TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, ...