1

Closed

error with sql server 'OBJECT_SCHEMA_NAME' not found

description

I got an error saying that 'OBJECT_SCHEMA_NAME' no es un nombre de función integrada reconocido. (is not a recognized integrated function name) , I have tested it in Sql Server and this function doesnt exists in my sql server 2005. I put below the code and the stacktrace:


const string providername = "System.Data.SqlClient";
connectionString = "Data Source=" + pro.host + ";Initial Catalog=" + pro.database + ";User ID=" + pro.user + ";Password=" + pro.password + ";";
var dbReader = new DatabaseReader(connectionString, providername);
var schema = dbReader.ReadAll();

stacktrace:

en System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)
en System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action
1 wrapCloseInAction)
en System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
en System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
en System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
en System.Data.SqlClient.SqlDataReader.get_MetaData()
en System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
en System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)
en System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
en System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
en System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
en System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
en System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
en System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
en System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
en System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
en DatabaseSchemaReader.ProviderSchemaReaders.SqlServerSchemaReader.ProcedureSource(String name)
en DatabaseSchemaReader.DatabaseReader.AllStoredProcedures()
en DatabaseSchemaReader.DatabaseReader.ReadAll()
en myway4.createModel.search(Object file) en D:\projects\myway4\myway4\createModel.cs:línea 89
Closed Dec 14, 2013 at 10:45 AM by Martinjw
Release v1.2.11.0

comments

Martinjw wrote Oct 17, 2013 at 1:19 PM

OBJECT_SCHEMA_NAME was introduced in SqlServer 2005 SP2
http://blogs.msdn.com/b/sqltips/archive/2007/03/23/object-name-enhancement-and-object-schema-name-addition-in-sql-server-2005-sp2.aspx

it's only use is in getting the stored procedure source. I'll update so that it fails silently and completes the schema read on Sql Server 2005 rtm.

Thanks for letting me know.

micuentadecasa wrote Oct 20, 2013 at 11:07 PM

Thanks.