導航:首頁 > 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伺服器名相關的知識