Common Errors During SQL Server Installation and Use

Source: Internet
Author: User
Tags microsoft sql server 2005 sql 2008 sql server driver mssqlserver odbc sql server driver

1) dbnetlib] [connectionopen (connect ().] SQL server does not exist or access is denied

Solution:

1. Choose SQL Server Configuration Manager> SQL server2008 network configuration> MSSQLServer protocol> TCP/IP.
2. Right-click to start TCP/IP
3. Double-click the property and set the TCP port in IP address all to 1433.
4. Restart the SQL Server 2008 service.

 

2) SQL Server ODBC data source connection failure problem invalid connection

Connection Failed:
Sqlstate: '20140901'
SQL Server Error: 14
[Microsoft] [odbc SQL Server Driver] [dbnetlib] connectionopen (invalid instance ()).
Connection Failed:
Sqlstate: '20140901'
SQL Server Error: 14
[Microsoft] [odbc SQL Server Driver] [dbnetlib] the connection is invalid.

Solution:

Startup service: SQL Server Browser and SQL Server VSS writer

 

(3)

_ Connectionptr: connection used by VC to develop databases using ADO
_ Recordsetptr: the record set used by VC to develop databases using ADO
Crecordset: a record set for developing databases using ODBC for VC
Cdatabase: connection to the development database of VC using ODBC

 

(4) When installing or uninstalling SQL server, an error occurs: a previously installed program has created a suspended file on the computer. You must restart the computer before running the installer ).

Solution:

1. Enter Regedit in start-> running (Registry Editor)
2. Go to HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Session Manager \
3. Right-click pendingfilerenameoperations in the right window, select Delete, and then confirm.
4. reinstall and solve the problem (if it is not solved, it is another problem ).

 

(5) Microsoft Visual Studio 2008 is installed on this computer.

Upgrade Microsoft Visual Studio 2008 to SP1 before installing SQL Server 2008. Visual Studio SP1 is available in http://go.microsoft.com/fwlink? Linkid = 159627
Find.

 

(6) When SQL is used to export a database, you need to separate the database from the task> detach the database before importing the database. MDF ;. LDF files are copied to others for use. Otherwise, the database that is not separated is directly used by others. When additional data is attached, an error is returned:

 

 

 

(7) When uninstalling SQL 2008, an error is prompted:

An error occurred while installing the SQL server program. The SQL Server installer encounters the following errors:

You cannot call invoke or begininvoke on the control before creating a window handle ..

 

The solution is similar to 4th!

 

(8) Performance Counter registry Configuration unit consistency failure

Http://www.cnblogs.com/bigboo/archive/2008/09/30/1302483.html

 

(9) How does the SQL query analyzer annotate code?

When the row --

Multiple rows /**/

(10) how to obtain data from the SQL 2008 database and convert it to the cstring type;

First, convert the variable of the _ variant_t type into a string,

_ Variant_t var;

Cstring STR; // converted string

// The following Code demonstrates how to convert to a C standard string
If (var. Vt = vt_i4)
{
Long lnum;
Char szch [21];
STR = var. bstrval;
Widechartomultibyte
(Cp_acp, 0, var. bstrval,-1,
Szch, sizeof (szch), null, null );
}

// The following Code demonstrates how to convert to a logical type
If (var. Vt = vt_bool)
{
Bool bvar;
Lnum = var. lval;
Bvar = var. boolvar = 0? False: true;
}

// The following Code demonstrates the remaining types (Supplement)
Switch (var. Vt)
{

Case vt_bstr: // VaR is BSTR type
STR = var. bstrval;
Break;

Case vt_i2: // VaR is short int type
Str. Format ("% d", (INT) var. ival );
Break;

Case vt_i4: // VaR is long int type
Str. Format ("% d", var. lval );
Break;

Case vt_r4: // VaR is Float Type
Str. Format ("% 10.6f", (double) var. fltval );
Break;

Case vt_r8: // VaR is double type
Str. Format ("% 10.6f", var. dblval );
Break;

Case vt_cy: // VaR is Cy type
STR = colecurrency (VAR). Format ();
Break;

Case vt_date: // VaR is date type
STR = coledatetime (VAR). Format ();
Break;

Case vt_bool: // VaR is variant_bool
STR = (var. boolval = 0 )? "False": "true ";
Break;

Default:
Str. Format ("unk type % d \ n", var. Vt );
Trace ("unknown type % d \ n", var. Vt );
}

For example:

_ Variant_t Var = m_precordout-> getcollect (_ variant_t) strcol); // strcol is a field in the database.

If (var. Vt = vt_date)
{
Cstring STR = coledatetime (VAR). Format ();
}

(11) Conversion between datetime and cstring

Cstring strcstring;
Strcstring = Y + "-" + M + "-" + D + "" + H + ":" + M + ":" + S;
Colevariant vtime (strcstring );
Vtime. changetype (vt_date );
Coledatetime datetime = vtime;

 

Coledatetime datetime = coledatetime: getcurrenttime ();
Cstring temptime;
Temptime = datetime. Format ("% Y-% m-% d % H: % m: % s ");

 

(12) datatime type fuzzy query

Select * from t where convert (varchar, sendtime, 120) Like '2017-08-18%'

Where: T is the database table, and sendtime is the field name of the time field in the database. In this way, you can query the records.

 

 

(13) when logging on to the server, an error occurred while establishing a connection with the server. (Provider: Shared Memory provider, error: 0-there is no process on the other end of the MPs queue .)

First, select the server (right-click)> Properties> Security> Server Authentication To "SQL Server and Windows Authentication mode"
Next, expand "security"-> login name-> select the sa Login Account (right-click)-> Status-> login to enable

(14) Microsoft SQL Server Error 233 solution:

A connection has been established with the server, but an error occurs during logon. (Provider: named pipeline provider, error: 0-there is no process on the other end of the pipeline .) (Microsoft SQL Server, error: 233)

Solution: Open "start-all programs-Microsoft SQL Server 2005-Configuration tool-SQL Server Configuration Manager", and find "SQL Server 2005 network configuration" in the pop-up window ", enable "named pipes" and "TCP/IP" under "MSSQLServer protocol", and then restart SQL Server.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.