.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Hiding Schema of Specific Tables

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :Sql Server

We are launching one of our products as Packaged Product or Commercial Off The Shelf (COTS) software. The software manages business data as well as application specific data into tables of SQL Server database.

When a client will install the project the schema will be copied to his machine's SQL Server, however i was wondering if i can prevent the client from viewing the schema and data of application specific tables.

These tables however should still be available to the application itself.

View Complete Post

More Related Resource Links

Schema Specific Procedure Calls

Hi , I have two schemas Say S1 and S2 . I have two procedures inside each of this schema say S1.P1 and S1.P2 for S1 and S2.P1 and S2.P2 for S2 . Is it possible to call S1.P2 from S1.P1 ? . it is possible to do this like EXEC [S1].P2 , but Wat I want to know is to 1) call EXEC statement directly without [S1] prefix and execute the target Procedure which belong to the same schema of the calling Procedure ?. Currently wat I am facing is when I try to call EXEC P1 it looks for Default Schema (dbo.P1) and throwing a "procedure not found" error . 2)Is there a way to get the current schema name inside  the SP while the  SP is executing ?

SQL Management Studio 2008, does not display tables with specific permissions


Prev Reference Question: http://social.msdn.microsoft.com/Forums/en-US/sqltools/thread/a6166b82-1e1a-4771-952d-a7b54e0b0f23?prof=required

I see the same problem with SQL 2008 Management Studio. I have different schema defined in my database, all the schema permissions work just fine in SQL 2005 but when viewed from SQL 2008. I cannot see tables for which i have given inidividual permissions. I have given SELECT permissions for those tables.

for example.

schema: dbo, schema1, schema2 ....

user: user1 (schema1 owner), user2 (schema2 owner), user3 ...

now i have given SELECT on schema1.table1 to user2

this works fine and i m able to see the schema1.table1 when login as user2 in SQL2005. I have tried your solution for giving "View Definition" permission as well. But this doesnt work in my case.

Seems to be some default permission settings with SQL 2008 ??

Any help/Suggestion will be appreciated

How to create tables from XSD schema?


I am newbie for xsd/xml.
Can you give me an idea how to create tables from the xsd at below.


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="listings" type="listingsType"/>
  <xs:complexType name="componentType">
      <xs:extension base="xs:string">
        <xs:attribute type="xs:string" name="name" use="optional"/>
  <xs:complexType name="addressType">
      <xs:element type="componentType" name="component" maxOccurs="unbounded" minOccurs="0"/>
    <xs:attribute type="xs:string" name="format" use=&qu

Offshore Host Renames Tables with Schema Name on Restore


I was so happy today when I checked a site that gets a lot of user submitted content and realized that I had been able to grab my database from my US hosting company, send it overseas, and get it restored without any new UGC to copy over. Then I realized that all of my queries were broken and after some trouble shooting I realized that all of my tables that were not part of the (dbo) schema were renamed in server explorer to include the name (defautschema) which would require the renaming of my queries to specify defaultschema.tablename on all non (dbo) schema tables.

The first thing I tried to do was right click on the names of the tables and select rename to delete them right there in Server Exporer, but no such option exists. Then I followed the directions for renaming tables, but the table names in the table definition do not include the schema names. I also tried deleting the schema, but got an error message saying that I have to have a schema.

Is there any way for me to change the names of the tables so that I don't have to add "schemaname." to every single column name in ever query that I have ever written?

Securing access to specific tables for Excel reporting


I am relatively new to SQL Server 2005 and inherited it as configured.   What I want to do is improve reporting capabilties to users through a tool they are familiar with, Excel 2003.   As admin, this is not a problem and I can report on all the tables.   For a user, I want to restrict which tables a user has access to.   Not sure how.  I have read some documentation, security best practices and lots of Googling.

The SQL Server is configured with a number of databases with each having lots of tables.  The one database I need to use has the tables the user needs but also a lot of tables he should not be accessing.  They all share the same schema.  I want to restrict the tables he can see when importing the data into Excel.    Not sure how and am hoping someone can provide some constructive suggestions, whether it can be done at all, or guidance as to where I can find the answer.   I've also thought of using a view but am not sure nor can I find where I can it make it avaible through Excel.

Any advise will be much appreciated.    I hope this makes sense.


MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.

Temporary Tables - MS SQL Server

Usage of temporary tables in MS SQL Server is more developer friendly and they are widely used in development. Local temporary tables are visible only in current session while global temporary tables are visible across all sessions.

Temporary tables in SQL Server vs. table variables

When writing T-SQL code, you often need a table in which to store data temporarily when it comes time to execute that code. You have four table options: normal tables, local temporary tables, global temporary tables and table variables. I'll discuss the differences between using temporary tables in SQL Server versus table variables.

Button specific code


I have 2 submit buttons on my page. Right now, the only way to run the code behind with razor is to to If(IsPost). Since I have 2 buttons, how would I destinguish between the two in post? Is there a way to request a button that sent a post request?  

Using a trigger or anything else to populate two tables


Hi! I'm creating an application that's supposed to first add a record to table1, and then get the ID from that record to use when adding a record to table2, to be able to associate these two records with eachother.

The user gets to type in some values that goes to table1, and some values that goes to table2, but before the insert statement for table2 is executed i need the ID from the recently added record in table1. Some dude told me to use a trigger for the autopopulate purpose, but does that really work when i also need to save some values that's user input, and when those values doesn't get saved in table1?

Are there any other way to do this or can i send values to a trigger? I'm new to triggers and stored procedures, i don't have any particular knowledge of this, any help is appreciated!


Regards, Monsterbadboll

How to extract a schema from a sql server database



  I need to extract or get the schema from tables in my databse and what is the best way to do it. Is there any third party tool to do it??


Any idea will be appreciated..



merging multiple tables in a single dataset to single table


 i have a stored procedure which returns three tables to a dataset ..... now i need to merge all three tables to a single table from d same dataset 

like dataset1 has table1 table2 and table3 .... i want all the three tabels to be merged into dataset1 itself .... instead of three diffrent tables so that i can show all three table data in a single datagrid  as a compact data and combination of 3 tables from d single dataset.....

can some1 help me please.....

SqlDataSource UpdateCommand using 2 tables


I have two tables

Trans  with fields TransID, Date, CustomerID and some other stuff

Customer with fields CustomerID, Name, TaxId

On the screen the user only sees the fields Date and Customer Name. CustomerID is behind the scenes only.


I'm using SqlDataSource. Having no problems with SelectCommand. I don't know how to construct the UpdateCommand and InsertCommand.

Let's say the user changes the date, then I need to do an UPDATE.

UPDATE Trans SET Date = @Date, CustomerID = @CustomerID results in an error message and the record is not updated.

I get an error on the page that says "Sys.WebForms.PageRequestManagerServerErrorException: Input string was not in correct format".


I tried taking out the set for CustomerID and I still get the error on page.


Also, for inserting, the users will see a dropdownlist with Customer Names. I need to convert that to a CustomerID to be used in the new record being inserted in the database. I'm not sure how to do this.


Do I need to do something with Control Parameters?

Getting list of users reporting from specific Manager from Active Directory


Dear All,

I am have requirement like displaying all the user information reporting to specific manager from Active Directory.

Please help me regarding this.



Create web site specific to mobile device, how to detect?



I have a website that is written in .Net 2.0 which uses all the nice rich functionality of the web (Ajax, javascript etc..).  However I have noticed that the site does not display very well on mobile devices. 

So therefore I would like to create a more streamlined version of my site that is better tailored to these devices.  However how do detect that the user has come to the site via a mobile device and how can i redirect them to my tailored page

Many thanks in advance

How to display related tables in one crystal report and how to link this report with combobox?


Hi! I want to display a crystal report in my vb.net application. Suppose I have tables named student details, student marks, student address, etc... Now if I want to display all these details (fields of all tables) in one crystal report (with page breaks if necessary) then how will I achieve it. I will be providing a combo box in my application that contains list of student names. How can I link this combo box with the cystal report to dynamically display report for different student on selected index change of combo box? Help me friends. An example would be appreciable.

Patterns in Practice: Internal Domain Specific Languages


Jeremy Miller explains how internal Domain Specific Languages can help you craft code that is easier to read and write. His bag of tricks to improve your programming includes extension methods, fluent interfaces, object extensions and use of the semantic model.

Jeremy Miller

MSDN Magazine January 2010

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend