locked
Query runs in MGMT studio but not in .Net code RRS feed

  • Question

  • Greetings,

    I am facing a problem with one of my query, I'm able to run that query in management studio after connecting through application userid and password, but the same query is not running from my .Net code. Please let me know what I'm doing wrong here.

    Let me know how to find permissions / privileges provided to the application user in sql server 2008.

    With regards,

    Gopinath.


    With regards, Gopinath.

    Wednesday, July 3, 2013 12:08 PM

All replies

  • not running from my .Net code. 

    Can you elaborate more? Is it giving some error? returning wrong data? Exception?

    - Vishal

    SqlAndMe.com

    Wednesday, July 3, 2013 12:10 PM
  • Its saying could not execute query and shows the query thats all.

    select sc.TABLE_SCHEMA  + '.' + t.name as Name, sc.TABLE_SCHEMA as [Schema], t.name as NameNoSchema, 
                                    sc.TABLE_CATALOG as [Database] 
                                    from sys.tables t join 
                                    INFORMATION_SCHEMA.TABLES sc ON t.name = sc.TABLE_NAME  AND sc.TABLE_SCHEMA IN('','dbo','GenesisLoad') AND sc.TABLE_NAME not like 'sys%'
                                    order by sc.TABLE_SCHEMA, t.name


    With regards, Gopinath.

    Wednesday, July 3, 2013 12:59 PM
  • The query looks fine and it should run without any issues. Please share your code used to run this query. Please post the exact error message if possible.

    - Vishal

    SqlAndMe.com

    • Proposed as answer by Fanny Liu Wednesday, July 10, 2013 9:54 AM
    Wednesday, July 3, 2013 2:43 PM