Unable to recognize table nale or filed names

  • Hi all,

    I have created a table name "tblPopulation" with fields 'Country', 'State' etc....

    When i query it with table name as tblpopulation with fields 'country', 'state' then i get error as invalid object name.

    I expect it to be a very small settings of case but could not figure out through google.

    Thank You

  • USE This

    Select * From information_Schema.Columns

    Where Table_Name like '%tblPopulation%'

    1st verify that table exists or not. If its exists check which Schema its using.

    Hope it helps

  • Table exists and the schema is dbo

  • let me make it clear.

    When i query with tblPopulation - i get the results

    When i query with tblpopulation - i get the error

  • You must be using a case sensitive collation on either the server or the database:

    http://msdn.microsoft.com/en-gb/library/hh230914.aspx

  • Server Collation is SQL_Latin1_General_CP1256_CS_AS

    Same implies for the column.

    I have several databases in the same server.

    I have a table name "Testmenu" in another database and it perfectly works if i query with 'testmenu' whereas 'tblpopulation doesn't work.

  • Then presumably the other database is case insensitive.

  • what is your database collation, have you checked it ?

  • Other databases has a collation "SQL_Latin1_General_CP1256_CI_AS" same as the database where i have a problem.

  • Thank You Cath.

    I t was collation issue.

  • Are you running your query in the same database where the table was created?

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply