mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 02:32:50 +08:00
通过 ManyToMany 测试
This commit is contained in:
parent
4667698d54
commit
e7be95e6aa
@ -118,7 +118,7 @@ namespace FreeSql.SqlServer {
|
|||||||
var loc3 = new Dictionary<int, Dictionary<string, DbColumnInfo>>();
|
var loc3 = new Dictionary<int, Dictionary<string, DbColumnInfo>>();
|
||||||
|
|
||||||
var sql = $@"
|
var sql = $@"
|
||||||
use {db};
|
use [{db}];
|
||||||
select
|
select
|
||||||
a.Object_id
|
a.Object_id
|
||||||
,b.name 'Owner'
|
,b.name 'Owner'
|
||||||
@ -146,7 +146,7 @@ inner join sys.schemas b on b.schema_id = a.schema_id
|
|||||||
where a.type = 'P' and charindex('$NPSP', a.name) = 0 and charindex('diagram', a.name) = 0
|
where a.type = 'P' and charindex('$NPSP', a.name) = 0 and charindex('diagram', a.name) = 0
|
||||||
order by type desc, b.name, a.name
|
order by type desc, b.name, a.name
|
||||||
;
|
;
|
||||||
use {olddatabase};
|
use [{olddatabase}];
|
||||||
";
|
";
|
||||||
var ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
|
var ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
|
||||||
if (ds == null) return loc1;
|
if (ds == null) return loc1;
|
||||||
@ -213,7 +213,7 @@ from sys.columns", loc8);
|
|||||||
,a.is_output 'IsIdentity'
|
,a.is_output 'IsIdentity'
|
||||||
from sys.parameters", loc88);
|
from sys.parameters", loc88);
|
||||||
}
|
}
|
||||||
sql = $"use {db};{sql};use {olddatabase}; ";
|
sql = $"use [{db}];{sql};use [{olddatabase}]; ";
|
||||||
ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
|
ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
|
||||||
if (ds == null) return loc1;
|
if (ds == null) return loc1;
|
||||||
|
|
||||||
@ -245,7 +245,7 @@ from sys.parameters", loc88);
|
|||||||
}
|
}
|
||||||
|
|
||||||
sql = $@"
|
sql = $@"
|
||||||
use {db};
|
use [{db}];
|
||||||
select
|
select
|
||||||
a.object_id 'Object_id'
|
a.object_id 'Object_id'
|
||||||
,c.name 'Column'
|
,c.name 'Column'
|
||||||
@ -259,7 +259,7 @@ inner join sys.indexes b on b.object_id = a.object_id and b.index_id = a.index_i
|
|||||||
left join sys.columns c on c.object_id = a.object_id and c.column_id = a.column_id
|
left join sys.columns c on c.object_id = a.object_id and c.column_id = a.column_id
|
||||||
where a.object_id in ({loc8})
|
where a.object_id in ({loc8})
|
||||||
;
|
;
|
||||||
use {olddatabase};
|
use [{olddatabase}];
|
||||||
";
|
";
|
||||||
ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
|
ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
|
||||||
if (ds == null) return loc1;
|
if (ds == null) return loc1;
|
||||||
@ -306,7 +306,7 @@ use {olddatabase};
|
|||||||
}
|
}
|
||||||
|
|
||||||
sql = $@"
|
sql = $@"
|
||||||
use {db};
|
use [{db}];
|
||||||
select
|
select
|
||||||
b.object_id 'Object_id'
|
b.object_id 'Object_id'
|
||||||
,c.name 'Column'
|
,c.name 'Column'
|
||||||
@ -322,7 +322,7 @@ inner join sys.columns c on c.object_id = a.parent_object_id and c.column_id = a
|
|||||||
inner join sys.columns d on d.object_id = a.referenced_object_id and d.column_id = a.referenced_column_id
|
inner join sys.columns d on d.object_id = a.referenced_object_id and d.column_id = a.referenced_column_id
|
||||||
where b.object_id in ({loc8})
|
where b.object_id in ({loc8})
|
||||||
;
|
;
|
||||||
use {olddatabase};
|
use [{olddatabase}];
|
||||||
";
|
";
|
||||||
ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
|
ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
|
||||||
if (ds == null) return loc1;
|
if (ds == null) return loc1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user