导航:首页 > IDC知识 > sqlserver服务器名

sqlserver服务器名

发布时间:2020-12-08 21:28:49

1、SQLserver2005在windows7系统里使用时的“服务器类型”和“服务器名称”是什么?

类型选择
引擎那个就可以了

服务器名称如果安装的过程中没有提示你输入,你就随便起个好了

身份验证
打SQL
S身份验证

登录名
呢,一般都为sa

2、SQL 服务器名称怎么填写

SQL服务器名称填写的具体操作步骤如下:

1、首先我们打开电脑桌面,找到桌面上的计算机图标,用鼠标右键点击计算机图标,在弹出来的下拉菜单里选择管理选项进入计算机管理设置界面,进入计算机管理界面后我们点击左侧快捷菜单栏里的SQL服务器选项。

2、然后我们会进入SQL服务器设置界面,点击并点击服务器名称后面的浏览更多选项,选择数据库引擎方式。

3、然后我们点开SQL SERVER网络配置下的小三角形,选择MSSQLSERVER选项,此时会弹出右边的属性框。

4、然后我们用鼠标右键点击选择TCP/IP,在下拉菜单里选择并点击属性选项。

5、此时会弹出TCP/IP属性设置界面,我们在这可以设置自己电脑的IP地址。

6、然后在刚才的SQL数据设置界面的服务器名称选项里我我们刚设置好的名字。

7、然后我们使用我们设置好的名称就可以登陆成功了,SQL服务器名称填写完毕。

3、必须使用计算机名称来进行SQLSERVER服务器的注册,是什么意思?。。。。!

亲,我们安装SQLserver完成之后,需要连接该服务器,那就需要该服务器的名称,而都是需要内使用安装SQLserver的电脑的名称进行容注册。右键点击“我的电脑”-“属性” 就能找到电脑的名称。当然也可以在里面将计算机名改成你喜欢的名称。

4、终于装上了sqlserver2005了,可是服务器名称写什么,求指教

楼主
这里有两个注意事项:1、sql主服务保证开启 2、服务名写对了
如果你安装的时候没有改实例名
那么你的服务名就是localhost或127.0.0.1或计算机名或直接写个.(英文状态下) 都可以
如果改了实例名 那么就是 计算机名\服务名
就按照我上面说的一个个的试 没有理由不成功 除非你安装失败

5、查询sqlserver所有服务器名

.net 列出局域网内所有的SQLserver服务器的名字

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Text;
using System.Runtime.InteropServices;

namespace showSqlServer
{
/**//// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
/**//// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
[DllImport("odbc32.dll")] private static extern short SQLAllocHandle(short hType, IntPtr inputHandle, out IntPtr outputHandle);
[DllImport("odbc32.dll")]
private static extern short SQLSetEnvAttr(IntPtr henv, int attribute, IntPtr valuePtr, int strLength);
[DllImport("odbc32.dll")]
private static extern short SQLFreeHandle(short hType, IntPtr handle);
[DllImport("odbc32.dll",CharSet=CharSet.Ansi)]
private static extern short SQLBrowseConnect(IntPtr hconn, StringBuilder inString,
short inStringLength, StringBuilder outString, short outStringLength,
out short outLengthNeeded);

private const short SQL_HANDLE_ENV = 1;
private const short SQL_HANDLE_DBC = 2;
private const int SQL_ATTR_ODBC_VERSION = 200;
private const int SQL_OV_ODBC3 = 3;
private const short SQL_SUCCESS = 0;
private const short SQL_NEED_DATA = 99;
private const short DEFAULT_RESULT_SIZE = 1024;
private System.Windows.Forms.ComboBox comboBox1;
private const string SQL_DRIVER_STR = "DRIVER=SQL SERVER";

public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();

//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}

public string[] GetServers()
{
string[] retval = null;
string txt = string.Empty;
IntPtr henv = IntPtr.Zero;
IntPtr hconn = IntPtr.Zero;
StringBuilder inString = new StringBuilder(SQL_DRIVER_STR);
StringBuilder outString = new StringBuilder(DEFAULT_RESULT_SIZE);
short inStringLength = (short) inString.Length;
short lenNeeded = 0;
try
{
if (SQL_SUCCESS == SQLAllocHandle(SQL_HANDLE_ENV, henv, out henv))
{
if (SQL_SUCCESS == SQLSetEnvAttr(henv,SQL_ATTR_ODBC_VERSION,(IntPtr)SQL_OV_ODBC3,0))
{
if (SQL_SUCCESS == SQLAllocHandle(SQL_HANDLE_DBC, henv, out hconn))
{
if (SQL_NEED_DATA == SQLBrowseConnect(hconn, inString, inStringLength, outString,
DEFAULT_RESULT_SIZE, out lenNeeded))
{
if (DEFAULT_RESULT_SIZE < lenNeeded)
{
outString.Capacity = lenNeeded;
if (SQL_NEED_DATA != SQLBrowseConnect(hconn, inString, inStringLength, outString,
lenNeeded,out lenNeeded))
{
throw new ApplicationException("Unabled to aquire SQL Servers from ODBC driver.");
}
}
txt = outString.ToString();
int start = txt.IndexOf("{") + 1;
int len = txt.IndexOf("}") - start;
if ((start > 0) && (len > 0))
{
txt = txt.Substring(start,len);
}
else
{
txt = string.Empty;
}
}
}
}
}
}
catch (Exception ex)
{
#if (DEBUG)
MessageBox.Show(ex.Message,"Acquire SQL Servier List Error");
#endif
txt = string.Empty;
}
finally
{
if (hconn != IntPtr.Zero)
{
SQLFreeHandle(SQL_HANDLE_DBC,hconn);
}
if (henv != IntPtr.Zero)
{
SQLFreeHandle(SQL_HANDLE_ENV,hconn);
}
}

if (txt.Length > 0)
{
retval = txt.Split(",".ToCharArray());
}

return retval;
}

/**//// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

Windows 窗体设计器生成的代码#region Windows 窗体设计器生成的代码
/**//// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// comboBox1
//
this.comboBox1.Location = new System.Drawing.Point(56, 32);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(121, 20);
this.comboBox1.TabIndex = 0;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(440, 302);
this.Controls.Add(this.comboBox1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);

}
#endregion

/**//// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}

private void Form1_Load(object sender, System.EventArgs e)
{
this.comboBox1.Items.Clear();
string[] SqlServer=this.GetServers();
if(SqlServer==null ||SqlServer.Length==0)
return;
foreach(string server in SqlServer)
{
this.comboBox1.Items.Add(server);
}
if(this.comboBox1.Items.Count>0)
this.comboBox1.SelectedIndex=0;
}
}
}

6、查询sqlserver所有服务器名

using System.Data.Sql;

class Program
{
static void Main()
{
// Retrieve the enumerator instance and then the data.
SqlDataSourceEnumerator instance =
SqlDataSourceEnumerator.Instance;
System.Data.DataTable table = instance.GetDataSources();

// Display the contents of the table.
DisplayData(table);

Console.WriteLine("Press any key to continue.");
Console.ReadKey();
}

private static void DisplayData(System.Data.DataTable table)
{
foreach (System.Data.DataRow row in table.Rows)
{
foreach (System.Data.DataColumn col in table.Columns)
{
Console.WriteLine("{0} = {1}", col.ColumnName, row[col]);
}
Console.WriteLine("============================");
}
}
}

7、sqlserver实例名字怎么连接服务器

简单的这样看
开始菜单下的 sqlserver配置管理器 -----sqlserver服务-------你看sqlserver()
括号里的为实例名
也可以按楼上的
在注册表里
(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\InstalledInstances)

服务—SQL Server(实例名),默认实例为(MSSQLSERVER)
或在连接企业管理时-查看本地实例

8、SQLServer2005没有“服务器名称”怎么办呢?

1、你是不是没装DataBase相关的安装啊?只装了管理组件?

2、如果装了DataBase;到控制面板、管理工具、服务 里面找 名称 “SQL Server *“ 【*】代表任意名称然后右键属性 去看,下图中被选中的地方 -s 后面的就是服务名称

 

 

与sqlserver服务器名相关的知识