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


Post New Web Links

2008R2 Strange schema related permission behaviour

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :
 

Hi All,

I have a database with schema foo with table test

i have a schema bar with view vw_test

 

create view bar.vw_test
as
select x,y,z from foo.test

etc etc etc

now i add a user to the server and database and just have grant select on schema::bar to user permissions

 

Now, if the behaviour was consistent between the database environments I'd know where to begin (all running sql server r2 (RTM) btw)

I add a sql service account to one environment and grant select on schema, works fine. I add an AD account, works fine

I try the same on another environment and it doesn't work unless i do something like
select * from bar.[vw_test];

Im not joking. select * from bar.vw_test wont work, neither will select * from bar.[vw_test]

it needs to have a ; or go after it

The error is

The SELECT permission was denied on the object 'test', database 'xx', schema 'foo'.

Is there some database or server level option that's inconsistent across the environments? I ran the schema compare is VS2010 but it didn't pick anything up.

If i change it to quoted_identifiers off then it's the opposite. It only works if the command is by itself- cant have 'go' or ; after it.

My expectation was that i wouldnt need to grant explicit permissions to the und


View Complete Post


More Related Resource Links

ASP.NET DateTime Conversion strange behaviour

  

Hi,

I am working on ASP.NET web application where we are using javascript calendar to accept the date in textboxes. The date format is dd/mm/yyyy. The application is running in US and UK environments.

I am facing issues in US environment while storing the dates so I have added 2 keys in config file viz culture which will be either en-US or en-GB depending on the deployment location and baseCulture which will always be en-GB.

In the code, I have added a condition which checks if culture and baseCulture values are not matching then do the conversion of date in US format.

But I have found that the code converts the date from dd/mm/yyyy to mm/dd/yyyy when the key is baseCulture (en-GB) and it throws FormatException when key is culture (en-US).

I am bit confused by this behaviour. Is this normal? Can any one please explain more about this? Note: I am working on a machine which has en-US as language and culture

<add key="culture" value="en-US" />
<add key="baseCulture" value="en-GB" />
// This line works and converts the date from 26/08/2010 to 08/26/2010
// Here the baseCulture is en-GB.
DateTime dt = DateTime.Parse(txtCurrentDate,baseCulture)

// This line throws FormatException. culture 

Insert permission was denied on Object '', database '', schema ''

  
i have a senario where in i am trying to insert data into a Database , i end up getting the above error 'Insert permission was denied on Object '', database '', schema '''.We have a DB which has all Storeprocedures and 90% of the tables . the remaining 10% of the tables are in a different database.I am having trouble inserting data into the second database.The storeprocedure is executed as a user who has permission on the DB and tables.Also the storeprocedure is given permission to a role in which the user is a member . The same role doesnt exists in the 2nd Database.I am able to do all DB operations in one environment . i am unable to do the same in the others.

VERY strange behaviour of IE7 and 8!

  
Today is a day where nothing seems to work out as expected.I'm currently making the HTML and Javascript templates for our new Corporate Page.The thing works as expected in Firefox, Opera, Chrome and IE 6, but not in IE 7 and 8!The "thing" is a menu/submenu written by me in javascript.The way it looks in Firefox etc:The way it looks in IE 7 and 8:There is absolutely no explanation for the strange "rounded" edge on the right and the gradient going over it.The background is a semi-transparent optimized PNG without color profiles which shows up gray in IE 6 and transparent in the other browsers - as expected.On my other developer's computer, it shows up perfectly in both IE 7 and 8.What could possibly create this behaviour?----source:<div class="subMenusContainer"> <div class="subMenu" id="aboutUsMenu"> <a href="/Home/AboutAurora">About AURORA</a> <a href="/Home/AboutErichKrammer">Erich Krammer</a> <a href="/Home/AboutFoundation">AURORA Foundation</a> <a href="/Home/AboutPartners">Partners</a> <a href="/Home/AboutCareers">Careers</a> <a href="/Home/AboutContact">Contacts</a> </div> [snip] <div class="subMenu&q

Strange Problem - SSIS Fails with "Syntax error, permission violation, or other nonspecific error".

  
Hello, I have a strange issue while I am deploying a package to one of the environment server. I have 2 XML Source, in the DataFlow, and one will extracted based on a value of variable that is passed from run time (package is executed from a Job) and other will be extracted all time. The next Step I have is a Execute SQL Task in ControlFlow wihich will execute after DataFlow. This has 2 input parameters and some SQL query that uses the param. Now this one fail on the target environment with below error: failed with the following error: "Syntax error, permission violation, or other nonspecific error". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. I got the error when I did a SSIS Text File Log. Note: If I run the package in BIDS with the same XML files it work. Also when I deploy the package to my Dev Server it works. When I compare the Dev DB with the target environment DB - Both are same. The Service Acount has permission - as I can see the DataFlow task completed. Another Point: The XML Load Data Flow that executes based on the Variable Value does not execute on target environment, even if the value is passed as "True" (It is Boolean Type) But this variable is NOT an input for the Execute SQL task that fails. I am not sure w

The SELECT permission was denied on the object 'sysjobs_view', database 'msdb', schema 'dbo'.

  
So, I have an SSIS package that uses a transfer jobs task between Server A and Server B.  When I run the package with my credentials, everything works fine.  However, when I run the package from an SSIS using a different user, I get the following error: Date 9/1/2010 8:00:00 AM Log Job History (xxx) Step ID 1 Server xxx Job Name xxx Step Name Run SSIS Duration 00:00:01 Sql Severity 0 Sql Message ID 0 Operator Emailed Operator Net sent Operator Paged Retries Attempted 0 Message Microsoft (R) SQL Server Execute Package Utility Version 10.0.2531.0 for 64-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Started: 8:00:00 AM Error: 2010-09-01 08:00:01.39 Code: 0xC002F325 Source: Transfer Jobs Task Transfer Jobs Task Description: Execution failed with the following error: "An exception occurred while executing a Transact-SQL statement or batch.". End Error Error: 2010-09-01 08:00:01.39 Code: 0xC002F325 Source: Transfer Jobs Task Transfer Jobs Task Description: Execution failed with the following error: "The SELECT permission was denied on the object 'sysjobs_view', database 'msdb', schema 'dbo'.". End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 8:00:00 AM Finished: 8:00:01 AM Elapsed: 0.75 seconds The strange thing is, the user running the job ahs sysadmin permissions

Strange behaviour of a query using a recursive CTE

  
Hi, I have a problem with a query. The situation is a bit complicated but I'll try to explain it the best I can. Short story: I have a .NET application that executes a recursive query (using CTE) and then uses a DataReader to read each row's each field one-by-one using the GetValue() method. With specific parameters this query behaves quite fast but with other parameters it can take more than a second to read a row's field (instead of the usual ~0.00001 second). Long story: The database: I have 4 tables with the following columns: 1. Entity table: Id (int), Version (bigint), InternalName (nvarchar(255)), ExternalName (nvarchar(255)), Description (nvarchar(2,000)). 2. Relation table: Id (int), Version (bigint), EffectiveStartTime (datetime), EffectiveEndTime (datetime), ParentEntityId (int), ChildEntityId (int), Ordinal (int). 3. Property table: Id (int), Version (bigint), InternalName (nvarchar(255)), ExternalName (nvarchar(255), Description (nvarchar(2,000)). 4. EntityProperty table with 10,000 rows: Id (int), Version (bigint), EffectiveStartTime (datetime), EffectiveEndTime (datetime), EntityId (int), PropertyId (int). The Entity table has 100,000 rows, the Relation table has 100,000 rows (each entity has a relation), Property table has 22 rows and the EntityProperty table has 2,010,000 rows (properties with Id from 1 to 20 are assigned to all entities and properties with

Strange behaviour of a query using a recursive CTE

  
Hi, I have a problem with a query. The situation is a bit complicated but I'll try to explain it the best I can. Short story: I have a .NET application that executes a recursive query (using CTE) and then uses a DataReader to read each row's each field one-by-one using the GetValue() method. With specific parameters this query behaves quite fast but with other parameters it can take more than a second to read a row's field (instead of the usual ~0.00001 second). Long story: The database: I have 4 tables with the following columns: 1. Entity table: Id (int), Version (bigint), InternalName (nvarchar(255)), ExternalName (nvarchar(255)), Description (nvarchar(2,000)). 2. Relation table: Id (int), Version (bigint), EffectiveStartTime (datetime), EffectiveEndTime (datetime), ParentEntityId (int), ChildEntityId (int), Ordinal (int). 3. Property table: Id (int), Version (bigint), InternalName (nvarchar(255)), ExternalName (nvarchar(255), Description (nvarchar(2,000)). 4. EntityProperty table with 10,000 rows: Id (int), Version (bigint), EffectiveStartTime (datetime), EffectiveEndTime (datetime), EntityId (int), PropertyId (int). The Entity table has 100,000 rows, the Relation table has 100,000 rows (each entity has a relation), Property table has 22 rows and the EntityProperty table has 2,010,000 rows (properties with Id from 1 to 20 are assigned to all entities and properties with

Strange Permission Problems with Sharepoint 2003

  
Hi We are having a problem with access permissions with sites created in Sharepoint.  We set the permissions for individual site via 'Site Settings' for that site and lock it down to certain individuals selected from Active Directory. However the problem is some users who are in the administrators Active Directory AD Group manage to get to access the site when they do not have any permissions set via 'site settings' Any ideas on why this is occuring and any possible solution. TIA

GRANT permission on schema to user in SQL 2000

  
Hi,I am using following statement to grant specified permissions on schema to a user in SQL Server 2005. GRANT SELECT, INSERT, UPDATE, DELETE, EXECUTE on ::[Schema Name] to [My DB User]I need to perform the same in SQL 2000. However, this does not work in SQL Server 2000. Is there any equivalent syntax which can be used in both (SQL 2000 & 2005).Thanks in advance...

WPF - strange context menu behaviour

  

Hi 

I create contextmenu using that code

 

 protected MenuItem itemAdd, itemDelete, itemSelectBranch, itemDeleteClasp;
  protected MenuItem itemCut, itemCopy, itemPaste, itemAddParent, itemPasteWithChildren;
  protected MenuItem itemAddTask, itemAddExtTask, itemAddMileStone;
 menu = new ContextMenu();
    itemAdd = new MenuItem
           {
             HorizontalAlignment = HorizontalAlignment.Left,
             HorizontalContentAlignment = System.Windows.HorizontalAlignment.Stretch,
             Header = "Add"
           };
    itemDelete = new MenuItem
             {
               HorizontalAlignment = HorizontalAlignment.Left,
               HorizontalContentAlignment = System.Windows.HorizontalAlignment.Stretch,
               Header = "Delete"
             };
    itemSelectBranch = new MenuItem
    {
      HorizontalAlignment = HorizontalAlignment.Left,
      HorizontalContentAlignment = System.Windows.HorizontalAlignment.Stretch,
                  Header = 

Strange validation behaviour on dynamically created controls

  

I'm trying to debug an application which generates a fixed number of questions from a database of 20 questions, and validate them on button click. On postback, I want the incorrect questions to be labeled red. However, all the questions are labeled red on postback. I'm almost positive that the problem is with "page_init" and "page_load",  I'm using session variables to keep track of the question IDs and invalid questions. Any help is appreciated.

Here is the sample code.

Protected Sub Page_Init(ByVal s As Object, ByVal e As EventArgs)
       dim i as integer
       if Not Page.IsPostBack then
           // generates a random integer array for loading the questions
       For i = 0 To 1  // I'm only loading two questions 
           extract_question(selected_array(i))   
        Next
        else     
              //extract_question queries the database and load the controls dynamically
               extract_question(CInt(session("check_0")))  
               extract_question(CInt(session("check_1")))           
         end if      
       end if 
    
    End Sub

Protected Sub Page_Load(ByVal s As Object, ByVal e As EventArgs)
        If page.IsPostBack then
         dim textlabel as string
            dim sessionvar as string
            dim sessionc

Very strange behaviour from WPF binding

  

 

I am currently using markup like the following:

 <Binding diagnostics:PresentationTraceSources.TraceLevel="High" RelativeSource="{RelativeSource Self}" Path="(PatientControls:Entity

Strange sorting behaviour on series groups

  

Hi guys

I'm seeing some very strange behaviour when trying to sort my series groups on a chart.

I have an Analysis Services dataset with Job Grades and Job Grade Codes, the job grade simply being a concatenation of the Job Grade and the word "GRADE", e.g.

1 |  GRADE 1

2 |  GRADE 2

3 |  GRADE 3 etc.

I've pulled in the field Job_Grade into my Series groups section for a chart. I then tried to sort it by the key value which is the Job_Grade_Code like this:

=Fields!Job_Grade.Key

This produced the following result:

 Grade 6

Grade 7

Grade 8.....

Grade 4

Grade 5

I noticed that the sorting was incorrect. I noticed that in the source the Job_Grade_Code field was a varchar value, so I changed the sorting expression to the following:

=Cint(Fields!Job_Grade.Key)

This however made no difference and still sorted my grades in the incorrect order

Strange Behaviour of For Loop

  

Hi Friends,

I am getting Strange behaviour from the for loop.

Here is the loop

for(i=1, i<=1000000, i++)

{

label1.text = string1;( string 1, 2 , 3 comming from logic)

label2.text = string2;

label3.text = string3; 

label4.text = string4;

once i got them i storing in the table of sql server using following steps,

SqlConnection conn = new SqlConnection();
                     conn.ConnectionString = " connectionstring ";
                     SqlCommand cmd = new SqlCommand();
                     cmd.CommandType = System.Data.CommandType.Text;
                     cmd.CommandText = "INSERT INTO table(value1, value2, value3, value4, value5) VALUES( @i, @value1,@value2,@value3,@value4)";
                     cmd.Parameters.Add(new SqlParameter("@i", i ))

SSAS: Strange filter behaviour in client

  

Hi,

 

In my cube I have one Time dimension that I use for filtering my data. The way I select my check boxes in the Time dimension influences the shown data. I checked the created filter by using SQL Server Profiler and this shows that the created filter is totally wrong!

 

Scenario 1 (NOK)

 

Steps

·        

Strange behaviour taxonomy filter in content query webpart on anonymous website

  

We are experiencing strange behaviour on a publishing facing website implemented in SharePoint 2010.

The story
We use a (default) Content Query Webpart to show related information in relation with the current page. The filter is using a field value (UserFieldValue) of the current page and filters other pages which have the same tags. The fields, on the current page and the related pages, are taxonomy field. Everything works fine!

We published the pages, looked at the website as an anonymous user and everything was still going smoothly. We went home, slepts an hour of 6, waked up. Proudly checked our beatifull new website :). Ahhhhh, what is this.. all content query webpart with the filters on the taxonomy field returned exactly nil.

We logged in to our website, checked if the pages where published, and well, they are... Just published them again. And everything looked fine again.... but not for long. Exactly the next day (... app pool recycle ...) the same problem ...

Logged in again to our website, logged out...  problem solved.... till the next apppool recycle.

My conclusion
Until the firrst authenticated visit to the page the taxonomy filter on the content query webpart silenty fails.

Resolution
As a "temporary" workarround we have created a sc

Extending OutputResponseStream but some strange behaviour???

  

Hi

I have trying to write a HttpHandler to Filter some content before rendering. As HttpApplication.Context.Response.OutputStream does not support manipulatiing at this stage. so, for remedy i am extending it to customize Write method

here is the code

using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;
using System.Text.RegularExpressions;

namespace WebApplication1
{
    public class StdViewStateRemover : System.Web.IHttpModule
    {
        private System.Web.HttpApplication mApplication;

        public StdViewStateRemover()
        {
        }

        public void Init(System.Web.HttpApplication application)
        {
            // Wire up beginrequest
            application.BeginRequest += new System.EventHandler(BeginRequest);
            // Save the application
            mApplication = application;
        }

        public void BeginRequest(Object sender, EventArgs e)
        {
            //for testing purposes i just checking jpg images
            if (((HttpApplication)sender).Request.Path.ToLower().Contains("jpg".ToLower()))
            {
                return
Categories: 
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