Reputation: 71
I have a MSSQL DB with about 3300tables (don't ask why, that's Nav...). When I try to "Update Model from Database..." on my EDMX I am getting a timeout exception 99 times out of 100. So my question is, is there anyway to change the timeout? I have tried to set "Connect Timeout" in the connection string, but it doesn't change anything.
I also tried to create a SQL account with an access on only the tables I need (about 10) but the timeout in the wizard still occur.
Upvotes: 4
Views: 1089
Reputation: 608
Someone at work just helped me with this.
Capture the SQL Query that Visual Studio trys to run. It should look something like this
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
Then run the query in SS Managment Studio. When you run the query the results should be cached. When Visual Studio runs the query again the results should come back really quick and it won't time out.
Upvotes: 3
Reputation: 71
A small work around :
Upvotes: 0