Actually, having downloaded 4.0 it STILL didn't show the Common or Sql library.
What I found out is that you have to select from the "Enterprise Library Data Access Application Block" (and similar) and no try to locate the assembly directly under "Microsoft Enterprise Library*"
I've already uninstalled v4.1 now but it did connect with v4.0 and this is is the exception:
(ObjectHelper.ObjectDb.FetchObjects(ScriptingOptions so) in C:\Users\Chris\Desktop\DBScripter_Src\ObjectHelper\ObjectDB.cs:line 315)
The SQL Commmand is:
SELECT COUNT(*) FROM sys.tables;
select
t.Object_Id,t.create_date,t.modify_date,
t.Name,
s.name as [Schema],
t.is_replicated AS [Replicated],
t.uses_ansi_nulls AS [AnsiNullsStatus],
CAST(OBJECTPROPERTY(t.object_id,N'IsQuotedIdentOn') AS bit) AS [QuotedIdentifierStatus],
CAST(case when ctt.object_id is null then 0 else 1 end as bit) AS [ChangeTrackingEnabled],
CAST(ISNULL(ctt.is_track_columns_updated_on,0) AS bit) AS [TrackColumnsUpdatedEnabled],
[FileGroup]=ISNULL((
SELECT
f.[name]
FROM
sys.indexes i INNER JOIN sys.filegroups f ON i.data_space_id = f.data_space_id
INNER JOIN sys.all_objects o ON i.[object_id] = o.[object_id]
inner join sys.tables tt on i.object_id=tt.object_id
where i.[type]=0 and i.object_id=t.object_id
),N'' ),
[PartitionScheme] = ISNULL((
select ps.name
from
sys.tables tt
LEFT JOIN sys.indexes idx on idx.object_id=tt.object_id
LEFT JOIN sys.data_spaces ds on idx.data_space_id=ds.data_space_id
LEFT JOIN sys.partition_schemes ps on ps.data_space_id = ds.data_space_id
where ds.type='PS' and tt.object_id=t.object_id
),N''),
[FileStreamGroup] = ISNULL((select ds.name from sys.data_spaces ds where ds.data_space_id=t.filestream_data_space_id and ds.type='FD' ),N''),
[FileStreamPartitionScheme]= ISNULL((select ds.name from sys.data_spaces ds where ds.data_space_id=t.filestream_data_space_id and ds.type='PS' ),N''),
[TextFileGroup]=ISNULL(dstext.name,N''),
[Description] = ISNULL((select value from fn_listextendedproperty ('MS_Description', 'schema', s.name, 'table', t.name, NULL, NULL)),N''),
[PartitionedColumn] = ISNULL(
(select c.name
from
sys.columns c
LEFT JOIN sys.indexes i on i.object_id = c.object_id
LEFT JOIN sys.index_columns ic on ic.object_id=c.object_id
LEFT JOIN sys.data_spaces ds on i.data_space_id=ds.data_space_id
LEFT JOIN sys.partition_schemes ps on ps.data_space_id=ds.data_space_id
where i.index_id=ic.index_id
and c.object_id=t.object_id
and ds.type='PS'
and ic.column_id=c.column_id),N''
)
from
sys.tables t
LEFT OUTER JOIN sys.schemas s on s.schema_id=t.schema_id
LEFT OUTER JOIN sys.data_spaces AS dsText ON t.lob_data_space_id = dstext.data_space_id
LEFT OUTER JOIN sys.change_tracking_tables AS ctt ON ctt.object_id = t.object_id ;
select
c.object_id,
c.column_Id,
c.name,
c.is_nullable,
c.is_computed,
c.is_identity,
c.is_filestream,
c.is_replicated,
c.is_rowguidcol,
c.is_sparse,
c.is_column_set,
[DataTypeId]=c.user_type_id,
[SystemDataTypeId]=c.system_type_id,
[Definition] =ISNULL(cc.[definition],N'') ,
[Type]=(select name from sys.types where sys.types.user_type_id=c.user_type_id),
[tablename]=t.name,
[Precision] = columnproperty(t.object_id,c.name,'Precision'),
[Collation] = c.collation_name,
c.Scale,
[Description] = ISNULL((select value from fn_listextendedproperty ('MS_Description', 'schema', s.name, 'table', t.name, 'column', c.name)) ,N''),
[IdentitySeed] = ISNULL(ic.seed_value,0),
[IdentityIncrement] = ISNULL(ic.increment_value,0),
[IsPersisted] = CAST(ISNULL(cc.is_persisted,0) as bit),
[IsUnique] = (
(select COUNT(*) from sys.index_columns idxc
left join sys.indexes idx on idx.object_id=idxc.object_id and idx.index_id=idxc.index_id
where idxc.object_id=c.object_id and c.column_id=idxc.column_id and idx.is_unique_constraint=1)
),
[IsUserDefinedDataType]=st.is_user_defined
from sys.columns c
join sys.tables t on c.object_id=t.object_id
join sys.schemas s on t.schema_id=s.schema_id
Left Join sys.identity_columns ic on c.object_id=ic.object_id and c.column_id=ic.column_id
Left Join sys.computed_columns cc on c.object_id=cc.object_id and cc.column_id=c.column_id
Left Join sys.types st on c.system_type_id=st.system_type_id and c.user_type_id=st.user_type_id;
select
p.object_id,
p.name,
s.name as SchemaName,
p.is_auto_executed,
p.is_execution_replicated,
p.is_repl_serializable_only,
OBJECT_DEFINITION(p.object_id) as [Definition],
m.uses_ansi_nulls,
m.uses_quoted_identifier,
p.create_date,
p.modify_date,
[Description] = ISNULL((select value from fn_listextendedproperty ('MS_Description', 'schema', s.name, 'procedure', p.name, NULL, NULL)),N'')
from sys.procedures p left join sys.schemas s on p.schema_id = s.schema_id
join sys.sql_modules m on m.object_id=p.object_id
select
[Type]=(select name from sys.types where sys.types.user_type_id=p.user_type_id),
[DataTypeId] = (select sys.types.user_type_id from sys.types where sys.types.user_type_id=p.user_type_id),
[SystemDataTypeId] = (select sys.types.system_type_id from sys.types where sys.types.user_type_id=p.user_type_id),
p.object_id,
p.name,
p.parameter_id,
p.max_length,
[precision] = columnproperty(p.object_id,p.name,'Precision'),
p.scale,
p.is_output,
[Default_Value] = ISNULL( p.default_value,N''),
p.is_xml_document,
p.xml_collection_id,
p.is_readonly,
xmlsc.name as [xmlcollection],
s2.name AS [XmlSchemaCollectionSchema],
[Description] =
case
when ISNULL((select value from fn_listextendedproperty ('MS_Description', 'SCHEMA', s.name, 'PROCEDURE', o.name, 'PARAMETER', p.name)),N'')!=''
then ISNULL((select value from fn_listextendedproperty ('MS_Description', 'SCHEMA', s.name, 'PROCEDURE', o.name, 'PARAMETER', p.name)),N'')
else
ISNULL((select value from fn_listextendedproperty ('MS_Description', 'SCHEMA', s.name, 'FUNCTION', o.name, 'PARAMETER', p.name)),N'')
end
from sys.parameters p
left join sys.xml_schema_collections xmlsc on p.xml_collection_id = xmlsc.xml_collection_id
left join sys.objects o on p.object_id = o.object_id
left join sys.schemas s on o.schema_id = s.schema_id
LEFT JOIN sys.schemas s2 ON xmlsc.schema_id = s2.schema_id;
select
v.object_id,
v.name,
s.name as SchemaName,
m.uses_ansi_nulls,
m.uses_quoted_identifier,
v.with_check_option,
m.is_recompiled,
m.is_schema_bound,
m.[definition],
[Description] = ISNULL((select value from fn_listextendedproperty ('MS_Description', 'SCHEMA', s.name, 'VIEW', v.name, null, null)),N'')
from sys.views v join sys.sql_modules m on v.object_id=m.object_id
join sys.schemas s on s.schema_id=v.schema_id;
select
c.object_id,
c.column_Id,
c.name,
c.is_nullable,
c.is_computed,
c.is_identity,
c.is_filestream,
c.is_replicated,
c.is_rowguidcol,
cast(0 as bit) as is_sparse,
cast(0 as bit) as is_column_set,
[Definition] =ISNULL(cc.[definition],N'') ,
[Type]=(select name from sys.types where sys.types.user_type_id=c.user_type_id),
[DataTypeId]=(select user_type_id from sys.types where sys.types.user_type_id=c.user_type_id),
[tablename]=t.name,
[Precision] = columnproperty(t.object_id,c.name,'Precision'),
[Collation] = c.collation_name,
c.Scale,
[Description] = ISNULL((select value from fn_listextendedproperty ('MS_Description', 'schema', s.name, 'view', t.name, 'column', c.name)) ,N''),
[IdentitySeed] = ISNULL(ic.seed_value,0),
[IdentityIncrement] = ISNULL(ic.increment_value,0),
[IsPersisted] = CAST(ISNULL(cc.is_persisted,0) as bit),
[IsUnique] = (
(select COUNT(*) from sys.index_columns idxc
left join sys.indexes idx on idx.object_id=idxc.object_id and idx.index_id=idxc.index_id
where idxc.object_id=c.object_id and c.column_id=idxc.column_id and idx.is_unique_constraint=1)
),
[IsUserDefinedDataType]=st.is_user_defined
from sys.columns c
join sys.views t on c.object_id=t.object_id
join sys.schemas s on t.schema_id=s.schema_id
Left Join sys.identity_columns ic on c.object_id=ic.object_id and c.column_id=ic.column_id
Left Join sys.computed_columns cc on c.object_id=cc.object_id and cc.column_id=c.column_id
Left Join sys.types st on c.system_type_id=st.system_type_id and c.user_type_id=st.user_type_id;
The full exception is:
[code]
System.Data.SqlClient.SqlException was unhandled by user code
Message=Incorrect syntax near 's'.
Incorrect syntax near ','.
Incorrect syntax near 's'.
Incorrect syntax near ','.
Incorrect syntax near 'sc'.
Incorrect syntax near 'sc'.
Incorrect syntax near 'sc'.
Incorrect syntax near 'sc'.
Incorrect syntax near 'sc'.
Incorrect syntax near 'sc'.
Incorrect syntax near 's'.
Incorrect syntax near 's'.
Incorrect syntax near 's'.
Incorrect syntax near 's'.
Incorrect syntax near 's'.
Incorrect syntax near 's'.
Incorrect syntax near ','.
Incorrect syntax near 's'.
Source=.Net SqlClient Data Provider
ErrorCode=-2146232060
Class=15
LineNumber=32
Number=102
Procedure=""
Server=(local)
State=1
StackTrace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoLoadDataSet(IDbCommand command, DataSet dataSet, String[] tableNames)
at Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet(DbCommand command, DataSet dataSet, String[] tableNames)
at Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet(DbCommand command, DataSet dataSet, String tableName)
at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteDataSet(DbCommand command)
at ObjectHelper.ObjectDb.FetchObjects(ScriptingOptions so) in C:\Users\Chris\Desktop\DBScripter_Src\ObjectHelper\ObjectDB.cs:line 315
at DBCompare.ObjectFetch.Script(Object[] scriptParams) in C:\Users\Chris\Desktop\DBScripter_Src\DBCompare\ObjectFetch.cs:line 144
at DBCompare.ObjectFetch.<>c__DisplayClass6.<ObjectFetch_Load>b__0() in C:\Users\Chris\Desktop\DBScripter_Src\DBCompare\ObjectFetch.cs:line 89
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
InnerException:
[/code]
God is REAL unless declared int
|