我有一个MSSQL数据库,有大约3300个表(不要问为什么,那是nav…)。当我尝试“从数据库更新模型。。。”在我的EDMX上,100次中有99次出现超时异常。所以我的问题是,有没有办法改变超时?我尝试在连接字符串中设置“连接超时”,但它没有改变任何东西。
我还尝试创建一个SQL帐户,只访问我需要的表(大约10个),但是向导中的超时仍然发生。
工作上有人帮了我这个忙。
>
SELECT
[Project1].[C1] AS [C1],
[Project1].[CatalogName] AS [CatalogName],
[Project1].[SchemaName] AS [SchemaName],
[Project1].[Name] AS [Name]
FROM ( SELECT
[Extent1].[CatalogName] AS [CatalogName],
[Extent1].[SchemaName] AS [SchemaName],
[Extent1].[Name] AS [Name],
1 AS [C1]
FROM (
SELECT
quotename(TABLE_SCHEMA) + quotename(TABLE_NAME) [Id]
, TABLE_CATALOG [CatalogName]
, TABLE_SCHEMA [SchemaName]
, TABLE_NAME [Name]
FROM
INFORMATION_SCHEMA.TABLES
WHERE
TABLE_TYPE = 'BASE TABLE'
) AS [Extent1]
) AS [Project1]
ORDER BY [Project1].[SchemaName] ASC, [Project1].[Name] ASC
然后在SS Managment Studio中运行查询。当您运行查询时,应该缓存结果。当Visual Studio再次运行查询时,结果应该很快返回,而且不会超时。
周围的一个小工作: