SlideShare uma empresa Scribd logo
1 de 16
Troubleshooting Guide




Problem No: 1 Connection Timeout Occurs.

Solution:

Check the server properties. Check the values of Remote Login Timeout

Steps:

Go to server properties.

Check Advance Tab. Change the value of Remote Login Timeout to
required values. Currently 600 secs.
Problem No: 2 Maximum connections with „sleeping‟ status.

Sometimes connection was opened and not closed. Execute this query to
get details.

sp_who „UserName‟

SELECT
   spid,login_time,
   master.dbo.sysprocesses.status,
   hostname,
   program_name,
   cmd,
   cpu,
    physical_io,
    blocked,
    master.dbo.sysdatabases.name,
    loginame
  FROM
    master.dbo.sysprocesses INNER JOIN
    master.dbo.sysdatabases ON
      sys.sysprocesses.dbid = sys.sysdatabases.dbid --where
program_name like '%.Net%'

ORDER BY spid


Solution:

Concern the person who has opened connection and ask to close the
connection if unnecessary opened.
Problem No: 3 SQL Server Login Password Expiration



When Password Expiry policy on that time password expiration issue
come.




Solution:

Unclick on Eforce policy and change the password to new password with
sa user.
Problem No: 4 Transaction logs not expanded.

When Memory of server disk full and transaction log and data file
cannot increase by size.

Solution:

Shrink the Datafiles and transaction logs.Expand the memory of disk(if
possible).
Problem No: 5 Objects locked by another session. Deadlock occurs

When table is locked by one session and not released it and another
session goes to wait state untill release by blocked session.

Get the Locked Object/Session Details.

Sp_lock

Sample output…

spid   dbid ObjId IndId Type   Resource Mode Status
51     4    0     0     DB                        S     GRANT
53     15 0       0     DB                        S     GRANT
54     5    0     0     DB                        S     GRANT
55     18 0       0     DB                        S     GRANT
56     18 0       0     DB                        S     GRANT
56     14 0       0     DB                        S     GRANT
56     18 1114487049           0   TAB                      Sch-S
       GRANT
56     14 946102411 0          PAG 1:4236               IS    GRANT
56     18 440388638 0          TAB                      IS    GRANT
56     14 1845581613           20 PAG 1:249589                    S
       GRANT


Solution:

Kill the session

Declare @SPID int

SET @SPID= --blocked object session

Kill( @SPID)

**Note:Be carefull to kill session.
Problem No: 6 Deleted Table Data.

When Developers deleted some data by mistake.

Solution:

Get Data from Backup file.

Restore it to some other database. Get Deleted data from restored backup.




Problem No: 7 Permission Denied on some operation.

Sometime all users don‟t have privileges to do all operation on
particular object.

Solution:

Provide necessary grant to particular users.
Problem No: 8 Connection Problems with sql server.

There is some problem with connecting sql server database from
ssms.

SQL Error: A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not found or was
not accessible. Verify that the instance name is correct and that SQL
Server is configured to allow remote connections. (Provider: TCP Provider,
error: 0 - No connection could be made because the target machine
actively refused it.) (Microsoft SQL Server, Error: 10061)

Solution:

Steps to follow.

Step.1 Check the connection information.

Instance Name, Username and password.

Step.2 Check the services of sql server running.

Step.3 Enable TCP/IP in SQL Server Configuration

Go to All Programs >> Microsoft SQL Server 2008 >> Configuration Tools
>> SQL Server Configuration Manager >> Select TCP/IP
Enable All Protocols except VIA.
Step.4 Enable Remote Connection
Go to Left Tab of Connections and check “Allow remote connections to this
server”
Step 5. Enable SQL Server Browser Service
Problem No: 9 cannot truncate table.Foregn Key reference.

When need to truncate table but got the error of foreign key violation.

SQL Error: Cannot truncate table 'dbo.tNewsPaper' because it is being referenced by a
FOREIGN KEY constraint.

Solution:

There is need to disable contraints and triggers on table.

Steps to follow.

Step 1.Disable Named foreign key contraints or disable all database
constraints.

EXEC sp_MSforeachtable @command1="ALTER TABLE ? NOCHECK
CONSTRAINT ALL"

Step 2.Disable Triggers.

EXEC sp_MSforeachtable @command1="ALTER TABLE ? DISABLE
TRIGGER ALL"

Step 3.Truncate table.

Step 4. Enable triggers and contraints.

EXEC sp_MSforeachtable @command1="ALTER TABLE ? CHECK
CONSTRAINT ALL"

EXEC sp_MSforeachtable @command1="ALTER TABLE ? ENABLE
TRIGGER ALL"
Problem No: 10 Reset Identity after all table data.

When all rows deleted and identity column need to reset to 1.

Solution.

Use DBCC CHECKIDENT

E.g

DBCC CHECKIDENT ("dbo.table1");

--For Some Specific value.

DBCC CHECKIDENT ("dbo.table1”, RESEED, 10);
Problem No: 11 Errors on Modifying Table Definition.

When “prevent saving changes that require table re-creation” enable.




Solution:

Go to Programs SQL Server Management
StudioToolsOptionsTable and Database Designers
Disable “prevent saving changes that require table re-creation”
Problem No: 12 SQL Server blocked access to STATEMENT
'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed
Queries' because this component is turned off as part of the security
configuration for this server.

When the sp_configure 'Ad Hoc Distributed Queries' returns 0 in value

Solution:

Execute this query…
sp_configure 'Ad Hoc Distributed Queries',1

Go

Reconfigure

Go
Problem No: 13 Value cannot be null. Parameter name: viewInfo
(Microsoft.SqlServer.Management.SqlStudio.Explorer).

When try to connect sql server from Management studio.

Error Description:
Microsoft.SqlServer.Management.RegisteredServers.RegisteredServerException: Unable to read the list of previously registered
servers on this system. Re-register your servers in the 'Registered Servers' window. --->
Microsoft.SqlServer.Management.Sdk.Sfc.SfcSerializationException: Deserialization operation on
/RegisteredServersStore/ServerGroup/CentralManagementServerGroup has failed. ---> System.IO.DirectoryNotFoundException:
Could not find a part of the path 'C:Usersdc_devAppDataLocalTemp2v9fgwzkq.tmp'.
  at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
  at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share,
Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
  at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
  at System.CodeDom.Compiler.TempFileCollection.EnsureTempNameCreated()
  at System.CodeDom.Compiler.TempFileCollection.AddExtension(String fileExtension, Boolean keepFile)
  at System.CodeDom.Compiler.TempFileCollection.AddExtension(String fileExtension)
  at Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources)
  at
Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(Compile
rParameters options, String[] sources)
  at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromSource(CompilerParameters options, String[] sources)
  at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters,
Evidence evidence)
  at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String
defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
  at System.Xml.Serialization.TempAssembly..ctor(



Solution:

Sometime in temp folder some folder removed by us and it needed to
connect to sql server.

Just need to create it again,

For E.g.

In path 'C:Usersdc_devAppDataLocalTemp2

Folder 2 is missing in it.

Create new folder 2 and try to connect it again.

Mais conteúdo relacionado

Destaque

Excalibur --
Excalibur --Excalibur --
Excalibur --Wes-Craft
 
Initial presentation
Initial presentationInitial presentation
Initial presentationrabiha01
 
Universal design for learning
Universal design for learningUniversal design for learning
Universal design for learningBeihong WU
 
SCG-putting-proposal
SCG-putting-proposal SCG-putting-proposal
SCG-putting-proposal Wes-Craft
 
Pasos de investigación
Pasos de investigaciónPasos de investigación
Pasos de investigaciónSamuel Kuartas
 
Wdr2013 oct7 final light
Wdr2013 oct7 final lightWdr2013 oct7 final light
Wdr2013 oct7 final lightCaroline Austin
 
Putting Course proposal for Sun City Grand
Putting Course proposal for Sun City GrandPutting Course proposal for Sun City Grand
Putting Course proposal for Sun City GrandWes-Craft
 
Introduccion a Investigacion de Operaciones - IO
Introduccion a Investigacion de Operaciones - IOIntroduccion a Investigacion de Operaciones - IO
Introduccion a Investigacion de Operaciones - IOYesith Valencia
 

Destaque (16)

Music Video Pitch
Music Video PitchMusic Video Pitch
Music Video Pitch
 
Music video pitch
Music video pitchMusic video pitch
Music video pitch
 
Excalibur --
Excalibur --Excalibur --
Excalibur --
 
Sweetx honey catalogue v1.2
Sweetx honey   catalogue v1.2Sweetx honey   catalogue v1.2
Sweetx honey catalogue v1.2
 
Sweetx honey catalogue v1.4
Sweetx honey   catalogue v1.4Sweetx honey   catalogue v1.4
Sweetx honey catalogue v1.4
 
Initial presentation
Initial presentationInitial presentation
Initial presentation
 
Universal design for learning
Universal design for learningUniversal design for learning
Universal design for learning
 
Excalibur -
Excalibur -Excalibur -
Excalibur -
 
Portafolio
PortafolioPortafolio
Portafolio
 
SCG-putting-proposal
SCG-putting-proposal SCG-putting-proposal
SCG-putting-proposal
 
CFP Evaluation 2016
CFP Evaluation 2016CFP Evaluation 2016
CFP Evaluation 2016
 
Pasos de investigación
Pasos de investigaciónPasos de investigación
Pasos de investigación
 
Wdr2013 oct7 final light
Wdr2013 oct7 final lightWdr2013 oct7 final light
Wdr2013 oct7 final light
 
Putting Course proposal for Sun City Grand
Putting Course proposal for Sun City GrandPutting Course proposal for Sun City Grand
Putting Course proposal for Sun City Grand
 
XML
XMLXML
XML
 
Introduccion a Investigacion de Operaciones - IO
Introduccion a Investigacion de Operaciones - IOIntroduccion a Investigacion de Operaciones - IO
Introduccion a Investigacion de Operaciones - IO
 

Semelhante a Sql Server troubleshooting guide

Easy MySQL Replication Setup and Troubleshooting
Easy MySQL Replication Setup and TroubleshootingEasy MySQL Replication Setup and Troubleshooting
Easy MySQL Replication Setup and TroubleshootingBob Burgess
 
2017 Thotcon - Hacking SQL Servers on Scale with PowerShell
2017 Thotcon - Hacking SQL Servers on Scale with PowerShell2017 Thotcon - Hacking SQL Servers on Scale with PowerShell
2017 Thotcon - Hacking SQL Servers on Scale with PowerShellScott Sutherland
 
M|18 Battle of the Online Schema Change Methods
M|18 Battle of the Online Schema Change MethodsM|18 Battle of the Online Schema Change Methods
M|18 Battle of the Online Schema Change MethodsMariaDB plc
 
Database security
Database securityDatabase security
Database securityJaved Khan
 
Creating "Secure" PHP applications, Part 2, Server Hardening
Creating "Secure" PHP applications, Part 2, Server HardeningCreating "Secure" PHP applications, Part 2, Server Hardening
Creating "Secure" PHP applications, Part 2, Server Hardeningarchwisp
 
Tracing and profiling my sql (percona live europe 2019) draft_1
Tracing and profiling my sql (percona live europe 2019) draft_1Tracing and profiling my sql (percona live europe 2019) draft_1
Tracing and profiling my sql (percona live europe 2019) draft_1Valerii Kravchuk
 
11 Things About11g
11 Things About11g11 Things About11g
11 Things About11gfcamachob
 
11thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp0111thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp01Karam Abuataya
 
10 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 2015
10 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 201510 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 2015
10 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 2015Scott Sutherland
 
Crs issue commands
Crs issue commandsCrs issue commands
Crs issue commandsraviranchi02
 
Headaches of Blocking, Locking, and Deadlocking
Headaches of Blocking, Locking, and DeadlockingHeadaches of Blocking, Locking, and Deadlocking
Headaches of Blocking, Locking, and DeadlockingBrent Ozar
 
2017 Secure360 - Hacking SQL Server on Scale with PowerShell
2017 Secure360 - Hacking SQL Server on Scale with PowerShell2017 Secure360 - Hacking SQL Server on Scale with PowerShell
2017 Secure360 - Hacking SQL Server on Scale with PowerShellScott Sutherland
 
Sql server clustering msdtc
Sql server clustering msdtcSql server clustering msdtc
Sql server clustering msdtcShreeram Rane
 
Fatkulin presentation
Fatkulin presentationFatkulin presentation
Fatkulin presentationEnkitec
 
MySQL Performance Schema in Action
MySQL Performance Schema in ActionMySQL Performance Schema in Action
MySQL Performance Schema in ActionSveta Smirnova
 
Scaling MySQL Strategies for Developers
Scaling MySQL Strategies for DevelopersScaling MySQL Strategies for Developers
Scaling MySQL Strategies for DevelopersJonathan Levin
 
JS Conf 2018 AU Node.js applications diagnostics under the hood
JS Conf 2018 AU Node.js applications diagnostics under the hoodJS Conf 2018 AU Node.js applications diagnostics under the hood
JS Conf 2018 AU Node.js applications diagnostics under the hoodNikolay Matvienko
 
SQL Server 2000 Installation Rollout Backout Plan
SQL Server 2000 Installation Rollout Backout PlanSQL Server 2000 Installation Rollout Backout Plan
SQL Server 2000 Installation Rollout Backout Plan► Supreme Mandal ◄
 

Semelhante a Sql Server troubleshooting guide (20)

Easy MySQL Replication Setup and Troubleshooting
Easy MySQL Replication Setup and TroubleshootingEasy MySQL Replication Setup and Troubleshooting
Easy MySQL Replication Setup and Troubleshooting
 
2017 Thotcon - Hacking SQL Servers on Scale with PowerShell
2017 Thotcon - Hacking SQL Servers on Scale with PowerShell2017 Thotcon - Hacking SQL Servers on Scale with PowerShell
2017 Thotcon - Hacking SQL Servers on Scale with PowerShell
 
M|18 Battle of the Online Schema Change Methods
M|18 Battle of the Online Schema Change MethodsM|18 Battle of the Online Schema Change Methods
M|18 Battle of the Online Schema Change Methods
 
Database security
Database securityDatabase security
Database security
 
DBCC - Dubi Lebel
DBCC - Dubi LebelDBCC - Dubi Lebel
DBCC - Dubi Lebel
 
Creating "Secure" PHP applications, Part 2, Server Hardening
Creating "Secure" PHP applications, Part 2, Server HardeningCreating "Secure" PHP applications, Part 2, Server Hardening
Creating "Secure" PHP applications, Part 2, Server Hardening
 
Tracing and profiling my sql (percona live europe 2019) draft_1
Tracing and profiling my sql (percona live europe 2019) draft_1Tracing and profiling my sql (percona live europe 2019) draft_1
Tracing and profiling my sql (percona live europe 2019) draft_1
 
DAC
DACDAC
DAC
 
11 Things About11g
11 Things About11g11 Things About11g
11 Things About11g
 
11thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp0111thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp01
 
10 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 2015
10 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 201510 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 2015
10 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 2015
 
Crs issue commands
Crs issue commandsCrs issue commands
Crs issue commands
 
Headaches of Blocking, Locking, and Deadlocking
Headaches of Blocking, Locking, and DeadlockingHeadaches of Blocking, Locking, and Deadlocking
Headaches of Blocking, Locking, and Deadlocking
 
2017 Secure360 - Hacking SQL Server on Scale with PowerShell
2017 Secure360 - Hacking SQL Server on Scale with PowerShell2017 Secure360 - Hacking SQL Server on Scale with PowerShell
2017 Secure360 - Hacking SQL Server on Scale with PowerShell
 
Sql server clustering msdtc
Sql server clustering msdtcSql server clustering msdtc
Sql server clustering msdtc
 
Fatkulin presentation
Fatkulin presentationFatkulin presentation
Fatkulin presentation
 
MySQL Performance Schema in Action
MySQL Performance Schema in ActionMySQL Performance Schema in Action
MySQL Performance Schema in Action
 
Scaling MySQL Strategies for Developers
Scaling MySQL Strategies for DevelopersScaling MySQL Strategies for Developers
Scaling MySQL Strategies for Developers
 
JS Conf 2018 AU Node.js applications diagnostics under the hood
JS Conf 2018 AU Node.js applications diagnostics under the hoodJS Conf 2018 AU Node.js applications diagnostics under the hood
JS Conf 2018 AU Node.js applications diagnostics under the hood
 
SQL Server 2000 Installation Rollout Backout Plan
SQL Server 2000 Installation Rollout Backout PlanSQL Server 2000 Installation Rollout Backout Plan
SQL Server 2000 Installation Rollout Backout Plan
 

Sql Server troubleshooting guide

  • 1. Troubleshooting Guide Problem No: 1 Connection Timeout Occurs. Solution: Check the server properties. Check the values of Remote Login Timeout Steps: Go to server properties. Check Advance Tab. Change the value of Remote Login Timeout to required values. Currently 600 secs.
  • 2. Problem No: 2 Maximum connections with „sleeping‟ status. Sometimes connection was opened and not closed. Execute this query to get details. sp_who „UserName‟ SELECT spid,login_time, master.dbo.sysprocesses.status, hostname, program_name, cmd, cpu, physical_io, blocked, master.dbo.sysdatabases.name, loginame FROM master.dbo.sysprocesses INNER JOIN master.dbo.sysdatabases ON sys.sysprocesses.dbid = sys.sysdatabases.dbid --where program_name like '%.Net%' ORDER BY spid Solution: Concern the person who has opened connection and ask to close the connection if unnecessary opened.
  • 3. Problem No: 3 SQL Server Login Password Expiration When Password Expiry policy on that time password expiration issue come. Solution: Unclick on Eforce policy and change the password to new password with sa user.
  • 4. Problem No: 4 Transaction logs not expanded. When Memory of server disk full and transaction log and data file cannot increase by size. Solution: Shrink the Datafiles and transaction logs.Expand the memory of disk(if possible).
  • 5. Problem No: 5 Objects locked by another session. Deadlock occurs When table is locked by one session and not released it and another session goes to wait state untill release by blocked session. Get the Locked Object/Session Details. Sp_lock Sample output… spid dbid ObjId IndId Type Resource Mode Status 51 4 0 0 DB S GRANT 53 15 0 0 DB S GRANT 54 5 0 0 DB S GRANT 55 18 0 0 DB S GRANT 56 18 0 0 DB S GRANT 56 14 0 0 DB S GRANT 56 18 1114487049 0 TAB Sch-S GRANT 56 14 946102411 0 PAG 1:4236 IS GRANT 56 18 440388638 0 TAB IS GRANT 56 14 1845581613 20 PAG 1:249589 S GRANT Solution: Kill the session Declare @SPID int SET @SPID= --blocked object session Kill( @SPID) **Note:Be carefull to kill session.
  • 6. Problem No: 6 Deleted Table Data. When Developers deleted some data by mistake. Solution: Get Data from Backup file. Restore it to some other database. Get Deleted data from restored backup. Problem No: 7 Permission Denied on some operation. Sometime all users don‟t have privileges to do all operation on particular object. Solution: Provide necessary grant to particular users.
  • 7. Problem No: 8 Connection Problems with sql server. There is some problem with connecting sql server database from ssms. SQL Error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (Provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.) (Microsoft SQL Server, Error: 10061) Solution: Steps to follow. Step.1 Check the connection information. Instance Name, Username and password. Step.2 Check the services of sql server running. Step.3 Enable TCP/IP in SQL Server Configuration Go to All Programs >> Microsoft SQL Server 2008 >> Configuration Tools >> SQL Server Configuration Manager >> Select TCP/IP
  • 8. Enable All Protocols except VIA.
  • 9. Step.4 Enable Remote Connection
  • 10. Go to Left Tab of Connections and check “Allow remote connections to this server”
  • 11. Step 5. Enable SQL Server Browser Service
  • 12. Problem No: 9 cannot truncate table.Foregn Key reference. When need to truncate table but got the error of foreign key violation. SQL Error: Cannot truncate table 'dbo.tNewsPaper' because it is being referenced by a FOREIGN KEY constraint. Solution: There is need to disable contraints and triggers on table. Steps to follow. Step 1.Disable Named foreign key contraints or disable all database constraints. EXEC sp_MSforeachtable @command1="ALTER TABLE ? NOCHECK CONSTRAINT ALL" Step 2.Disable Triggers. EXEC sp_MSforeachtable @command1="ALTER TABLE ? DISABLE TRIGGER ALL" Step 3.Truncate table. Step 4. Enable triggers and contraints. EXEC sp_MSforeachtable @command1="ALTER TABLE ? CHECK CONSTRAINT ALL" EXEC sp_MSforeachtable @command1="ALTER TABLE ? ENABLE TRIGGER ALL"
  • 13. Problem No: 10 Reset Identity after all table data. When all rows deleted and identity column need to reset to 1. Solution. Use DBCC CHECKIDENT E.g DBCC CHECKIDENT ("dbo.table1"); --For Some Specific value. DBCC CHECKIDENT ("dbo.table1”, RESEED, 10);
  • 14. Problem No: 11 Errors on Modifying Table Definition. When “prevent saving changes that require table re-creation” enable. Solution: Go to Programs SQL Server Management StudioToolsOptionsTable and Database Designers Disable “prevent saving changes that require table re-creation”
  • 15. Problem No: 12 SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server. When the sp_configure 'Ad Hoc Distributed Queries' returns 0 in value Solution: Execute this query… sp_configure 'Ad Hoc Distributed Queries',1 Go Reconfigure Go
  • 16. Problem No: 13 Value cannot be null. Parameter name: viewInfo (Microsoft.SqlServer.Management.SqlStudio.Explorer). When try to connect sql server from Management studio. Error Description: Microsoft.SqlServer.Management.RegisteredServers.RegisteredServerException: Unable to read the list of previously registered servers on this system. Re-register your servers in the 'Registered Servers' window. ---> Microsoft.SqlServer.Management.Sdk.Sfc.SfcSerializationException: Deserialization operation on /RegisteredServersStore/ServerGroup/CentralManagementServerGroup has failed. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:Usersdc_devAppDataLocalTemp2v9fgwzkq.tmp'. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access) at System.CodeDom.Compiler.TempFileCollection.EnsureTempNameCreated() at System.CodeDom.Compiler.TempFileCollection.AddExtension(String fileExtension, Boolean keepFile) at System.CodeDom.Compiler.TempFileCollection.AddExtension(String fileExtension) at Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources) at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(Compile rParameters options, String[] sources) at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromSource(CompilerParameters options, String[] sources) at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence) at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies) at System.Xml.Serialization.TempAssembly..ctor( Solution: Sometime in temp folder some folder removed by us and it needed to connect to sql server. Just need to create it again, For E.g. In path 'C:Usersdc_devAppDataLocalTemp2 Folder 2 is missing in it. Create new folder 2 and try to connect it again.