Server Names Or Instance Names
Hello there. I'm trying to populate a drop down box with a list of all available instances of SQL server (express or not) available on a network. To list all instances I'm using EnumAvailableServers() in SmoApplication.
The issue is that the Instance column in the returned data table is always empty, and both the Name and the Server columns contain the same string -- the name of the computer the SQL server is installed. Locally I have SSE installed, the instance name is <computer_name>SQLEXPRESS, however, using Smo I can't seem to get to the either full instance name or just the instance name. I can't assume SQLEXPRESS, since there may be more than one installed.
Alternately I used EnumRegisteredServers() in SmoApplication.SqlServerRegistrations and that, while returning instance information (can be retrieved from the RegisteredServer in the returned collection), doesn't always return the remote SQL servers in the list.
Any idea how can this be done? Maybe I'm going at it the wrong way, maybe there's another class / method I need to use to retrieve all instances?
Thank you
View Complete Forum Thread with Replies
Related Forum Messages:
Are Duplicate Instance Names A Problem If Physical Server Names Are Different?
If I restore the master database from ServerA to ServerB and start the SQL Server services on ServerA and ServerB, the master databases will be identical and running sp_helpserver and @@ServerName will indicate the SQL Server instance for both instances is ServerA. Is this ok considering the physical server names are different? If this is ok, how does SQL Server advertise on the network who it is? Does it append the physical server name to the SQL Server instance name during network communications? Thanks, Dave
View Replies !
DB Mirroring: Different Server Names With Same Instance Names
I'm going to be setting up DB mirroring between two SQL Server 2005 boxes. Since these are on two different servers, can the instance names be the same? Is there any reason NOT to do so if the mirror server is going to be used exclusively for DB mirroring? For example: if the my primary DB is located on SERVER1INSTANCE1, can the mirror be SERVER2INSTANCE1 or do the instance names have to be different even though they're on different boxes. Thanks!
View Replies !
Connecting To A Names Instance Through A Firewall.
Hi I am really struggling with this problem. I am connecting to several SQL 2000 servers on another LAN from my workstation and I have to go through a firewall. I got the firewall people to open port 1433 and was then able to connect any server with a default instance using Query Anlyzer and the IP address of the Server. When I try to connect from my workstation to a server with a named instance I am being blocked by the firewall before it gets to the server. I went into Client Network Utility on my workstation and removed named pipes which only left Tcpip using port 1433. Fire wall is now blocking “nbname UDP 137”. Is there a setting somewhere on my workstation that I can force the traffic to the named instance to use Tcpip through port 1433. Any Help would be great.
View Replies !
Table Names And Field Names
I'm trying to do an update query that looks like this: UPDATE PAEMPLOYEE SET PAEMPLOYEE.LOCAT_CODE = EMPLOYEE.PROCESS_LEVEL FROM PAEMPLOYEE A JOIN EMPLOYEE B ON A.EMPLOYEE = B.EMPLOYEE It's erroring out on the Employee prefix B.EMPLOYEE saying: ..."does not match with a table name or alias name used in the query" Is it wrong or will it cause problems to have a field name the same as the table name?
View Replies !
Different Server Names
Hello, I am using ADO controls for MSSQL Database. The server name on my machine is different from the server name on the machine where i am running my application. When i make changes to my application, i have to rebuild the connection on my ADO Control. Is there a way to create a server name on my developement machine to match the server name where i run my application? Would appreciate any help.
View Replies !
Server Names
Are there any problems w/ installing SQL Server 7.0 on a computer with a name such as 05005sql? I know that SQL will take the computer name as the SQL Server name, however, I am concerned about the numeric beginning of the computer name. Any suggestions?
View Replies !
Changing Server Names
I changed the name of a server that runs SQL Server 2005 and Reporting Services web site. I can't connect back to reporting services now using the new server name. I had to do some things to get SQL Server and Analysis Services to work, but I can't find any information on getting Reporting Services to run, I found something about changing config files, but no direction on what those files are. Thanks for any help, JB
View Replies !
Could Not Get SQL Server Instances Names
Hello, Here is my setup: 2 node active/passive Microsoft cluster running SQL 2005 Enterprise Ed w/ SP2. The SQL setup is configured as a named instance, servernameinstancename. When I tried to install SCOM 2007, I'm getting this error, "Could not get SQL server instances names." What could be the cause of this error? Any help would be appreciated!!
View Replies !
Changing Server Names In Cluster
Hi, I was wondering if it is possible to change a server / virtual server name in a cluster? I'm aware you can change the IP address but I couldn't find anything on changing the server / virtual server name. I am curious because at some stage we'll be moving from NT 4.0 domain to W2K AD which will include changing all our server / workstation names. Any ideas or help is appreciated. Cheers Willz
View Replies !
Server Names And Valid Characters
Setup: I have run into the following problem several times: An NT Servr is named this-that. When I install SQL Server 6.5, it fusses about the server name and leaves the master..sysservers table empty. This is due to SQL 6.5 not allowing dashes in SQL server names even though NT Server allows it. (I`ve always thought this was strange, but whatever.) Question: Will this continue to be true under SQL 7.0? TIA
View Replies !
Retrieve Names Of Users From Sql Server
how to retrieve names of the users between start time and end time using stored procedure in sql server?? i have a table which stores user names along with other details. can anybody tell me how to get the names of the users between start time and end time??
View Replies !
How To Get The List Of Names Of The Databases Of A Server Using OleDbConnection In C#.......?
I want to get the names of the databases of the server using OleDbConnection in c# which i have to add in to a combobox.....the same task i achieved using SqlConnection where in there is a Class SqlClientCollectionNames...the code is as followsusing (SqlConnection connection =new SqlConnection("Data Source=server;User ID=username;Password=passwd")) { connection.Open(); DataTable myData = connection.GetSchema(SqlClientMetaDataCollectionNames.Databases); foreach (DataRow row in myData.Rows) comboBox1.Items.Add(row[0]); connection.Close();} but the same i did for OleDbConnection it is not working using (OleDbConnection connection =new OleDbConnection("Provider=SQLOLEDB;Data Source=server;User ID=username;Password=passwd")) { connection.Open(); DataTable myData = connection.GetSchema(SqlClientMetaDataCollectionNames.Databases);//no such method Databases present in OleDb namespace foreach (DataRow row in myData.Rows) comboBox1.Items.Add(row[0]); connection.Close(); } is there any other way to do this using OleDbConnection........??Please help
View Replies !
Changing Field Names Is SQL Server 2000
Why is it that when you change a field name is SQL Server it sometimes completely messes things up. I renamed a field in one of my tables from Emp# to EmpNumber. I had a view based on this table and naturally I knew I would have to change a view I had based on the table. I opened the view and changed the field from Emp# to EmpNumber but when I tried to open the view I got an error “Invalid column Name EMP#”. I have not been able to fix this. I have dropped and recreated the view, refreshed all the objects using enterprise manager, refreshed all the objects using Query Analyzer, shut down and restarted my computer, taken my database offline and put it back on line. The field name EMP# is not in any tables in my database and not referenced any views or procs . I am just starting on this database so I could verify this very easily because I only have a few views and procs. Has anyone had this problem or more importantly does anyone know why this is happening or how to fix it?
View Replies !
Rename Server Names In Enterprise Manager?
Hi there. Sorry 'bout my bad english. Is there any possibility, to change the current server name from the stuctureview in the Enterprise Manger. I'm registering a lot of online-servers from my customers. The remote servername is fixed of course, but I want to change it local, to explain it a little bit better (e.g. "W2KSQLSRV" -> "CustomerXY") Can someone give me a hint, please? Thanx.
View Replies !
Changing Linked Server Names Between Environments
If I have stored procedures that reference linked servers, is there any way to avoid changing the procedures when moving between environments (dev, qa, prod)? Do i resort to dynamic sql? Use case statements to switch between environments? Any experience or advice is appreciated.
View Replies !
Microsoft SQL Server Express 2005 Spaces In Names
Hi, I'm starting to develop an application using Microsoft SQL Server Express 2005. I was wondering if it can handle spaces in column names and/or table names? I know that in some sql languages, you have to surround the name with brackets like this: [column name with spaces] I was wondering how well MSSQL 2005 handles this and if it's a good idea to use spaces in names or if it's a better idea to just get rid of all the spaces altogether? Thanks!
View Replies !
SQL Server Cursor Names - Missing From Dm_exec_cursors? API_CURSOR0000000000000003435 ?
Hi, We have an application that uses a large number of cursors, and I can run sys.dm_exec_cursors (0) to view them. However, the 'name' column always appears to be NULL no matter when I run the query. I see, when tracking some blocked processes, that the blocked processes usually have in inputbuffer that looks something like FETCH API_CURSOR00000000000003435 - which I'm trying to map back to the cursor itself. However, I can't seem to do so based on the name - since it isn't in the DMV. Can anyone shed any light on this one? Thanks in advance, Chris Camadella chris@vroominc.com
View Replies !
Row Values As Column Names In Sql Server 2005-any Ideas?
The table tA contains (here I m using storedprocedure to return the values as columns varchar(8000)) ID LocationName 1 Door 2 FrontCounter The number of records may vary like sometimes it have 2 or 3 or 4 or more records So I have to return row values as column name. tAChild POSID storeID tAID Auth 1 140 1 true 1 140 2 false Result Should be like ( to create this I m using SP with Dynamic sql query to create temp table) POSID storeID Door Window 1 140 true true if more records in tA it should append in the end of result as new column... Is this the above is right way to implement ?any other ideas about this... Please suggest me......
View Replies !
ClickOnce Path Names Are Too Long For SQL Server Express Identifiers
I'm posting this in the ClickOnce forums as well... My application doesn't include the .mdf and .ldf files, rather it creates the database the first time the application is run using a script that is included in the build. I want to create the database in the ClickOnce data directory. The problem I'm having is that SQL Server complains when I execute the CREATE DATABASE command as follows: CREATE DATABASE [C:Documents and SettingsxxxxxLocal SettingsApps2.0DataPQCK6EXN.5KGAW630RPT.VGOifie..tion_014028c05b1d6ec6_0001.0002_0e86966f19503c89DataiFieldMobile.mdf] ON PRIMARY ( NAME = N'myDatabase', FILENAME = N'C:Documents and SettingsxxxxxxLocal SettingsApps2.0DataPQCK6EXN.5KGAW630RPT.VGOifie..tion_014028c05b1d6ec6_0001.0002_0e86966f19503c89DatamyDatabase.mdf' , SIZE = 3136KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) LOG ON ( NAME = N'myDatabase_log', FILENAME = N'C:Documents and SettingsxxxxLocal SettingsApps2.0DataPQCK6EXN.5KGAW630RPT.VGOifie..tion_014028c05b1d6ec6_0001.0002_0e86966f19503c89DatamyDatabase_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%) END Here's the error: System.Data.SqlClient.SqlException "The identifier that starts with 'C:Documents and SettingsxxxxxxLocal SettingsApps2.0DataPQCK6EXN.5KGAW630RPT.VGOifie..tion_014028c05b1d6ec6_0001.00' is too long. Maximum length is 128."
View Replies !
Forward Dependency Error In SQL Server Reporting Services Table Names
Hi I am creating a report on a database where some of the table names start with the @ sign - ie @table1. Reporting services picks this up as a parameter, instead of a table name in my query, even though I am encapsulating the table name in square brackets eg. [@table1] I have several data sets in the report that i am using to populate valid parameters. These datasets are all variations of queries from tables that have @ as the first character. When i then try to run the report i get an error message as follows: "The report parameter pool has a default value or a valid value that depends on the report parameter SD_POOLCONTRACTS. Forward dependencies are not valid" This is frustrating as SD_POOLCONTRACTS is not a report parameter but one of the database tables that has @ for it's first character. here is the query that i use to obtain the valid values for the pool report parameter that i am trying to set up. SELECT distinct u_poolcode as Pool FROM OCRD INNER JOIN OCRG ON OCRD.GroupCode = OCRG.GroupCode INNER JOIN CRD1 ON OCRD.CardCode = CRD1.CardCode inner JOIN [@SD_POOLCONTRACT] INNER JOIN [@SD_POOLCONTRCT_LINE] ON [@SD_POOLCONTRACT].DocEntry = [@SD_POOLCONTRCT_LINE].DocEntry INNER JOIN [@SD_CONTRACTS] ON [@SD_POOLCONTRCT_LINE].U_DocNo = [@SD_CONTRACTS].DocNum ON case when len(ocrd.fathercard) = 0 then ocrd.cardcode else ISNULL(OCRD.FatherCard, OCRD.CardCode) end = [@SD_CONTRACTS].U_CardCode WHERE (OCRD.CardType = 'c') AND (OCRG.GroupName LIKE N'producer%') AND (CRD1.AdresType = 'b') ORDER BY OCRG.GroupName, FatherCard, OCRD.CardCode Any help would be appreciated.
View Replies !
Checking Server Availability When Using Dynamic Server/DB Names
I am building an SSIS package that is hitting about 50 remote servers. I have a for each loop container that i am using to build the list of servers to run. The problem is...sometimes networks go down, sometimes connections time out and this causes my entire package to fail. I inserted a task that will run select @@ServerName on the remote server inside the loop. My thought was, if this returns an error I could ignore it and move on to the next server in the list and log somewhere that server x threw an error. Logging is easy, the problem is, how do I then tell it to move on to the next server in the loop? If anyone has any suggestions on how better to do this, I am open for alternatives...
View Replies !
Get Column Names
Hi,How do I display the column names from my Sql server table?In asp3 the recordset allowed thisforeach key in rs ColumnName = key.name ColumnValue = key.valuenextHow do I do this in .Net?I want to use a DataReader so I can read through each record and only display the ones I want.TABLE_ONEColumn_OneColumn_TwoColumn_Threethanks,
View Replies !
Getting The Column Names
Hello, Im trying to get the column names from a database and display them in textboxes. someone has already helped me by tellnig me that i need to use the FillSchema command. Which works just fine and I can see only the colum names in a datagrid when i bind it to that. The problem is that I do not know how to extract the name of a column and put it in to a textbox ? does anybody know how I can fo this ? Thanks a million Rob
View Replies !
Weekday Names
Sql server 2000 -sql query analyzerselect datename(dw,'01-01-2006')returns sundayNow I do:set language danishselect datename(dw,'01-01-2006')returns sonday. But it should be søndag. Same goes forsaturday/lordag/lørdagTried substring'ing and ascii'ing/unicode'ing and it is AFAIK an o insteadof the special danish character ø.Is this a "feature" or am I doing something wrong?I "solved" it by doingselect case DATENAME(dw,'01-01-2006') WHEN 'lordag' THEN 'lørdag' WHEN'sondag' THEN 'søndag' ELSE DATENAME(dw,'01-01-2006') ENDbut it sure aint pretty./jim
View Replies !
Backup Names
Okay, here is a real mellon scratcher. I've got a server I've gotsemi-automated backups on. A typical backup looks like:BACKUP DATABASE MasterTO DISK = 'c:ackupsMaster20070418.bak'WITH FORMATThen I'll do a log backup if applicable (Not for Master). I then getsome error about the device being offline. But if I run:BACKUP DATABASE MasterTO DISK = 'c:ackupsMaster20070418.log'WITH FORMATthen it works fine. The ONLY thing I've changed is the extension onthe backup file. But that is what I wanted to name the log. As aworkaround I have the backups saved as:Master20070418-bak.log and then name the log files the way they shouldbe. That works, but I don't like it.Security is full access to Everyone, so I don't think it is an access/permissions issue.Any ideas?Thanks,-Utah
View Replies !
SP And Transaction Names
Is it possible for MS SQL 2k to get confused when we have two stored proces that has the same name for their transactions and both stored procs are exec at the same time? Example: Create Procedure SP1 as Begin Transaction TranName1 Commit Transaction TranName1 Begin Transaction TranName2 Commit Transaction TranName2 Create Procedure SP2 as Begin Transaction TranName2 Commit Transaction TranName2 Begin Transaction TranName3 Commit Transaction TranName3 We are seeing some very weird data corruption but luckily its been way under 1%(something like 500 bad rows out of a few million). The only thing we can think of since it is such a very low number is maybe when blocking occurs SQL has trouble handing two transactions with the same name in its queue. Beyond that we have no idea what could be causing this issue.
View Replies !
NT User Names
Hi Is it possible to obtain an NT username (with T-SQL) from a user connecting to SQL Server with a SQL log in via ODBC? Thanks in advance
View Replies !
Alternate Names
I need to implement support for alternate names on the database I’m working on. When a user looks up: “Antony Bigglesworth” the query would return both: Antony Bigglesworth as well as Tony Bigglesworth, would both exist. Anyone has a best practice on this or has done this before?
View Replies !
.mdf And .LDF File Names
Hi All, I am using query analyzer to execute my sqls . I want to take out .mdf and .LDF files and put it in another machine . But there is no .mdf or .LDF file with prefix as my database name . I think the file name might be something else . Please help me in finding out the .mdf and .LDF of a particular database . Thanks , Sushi
View Replies !
Bad Index Names
I have inherited a database which had no clustered indexes at all, only non-clustered. WHen I started experimenting with creating some I got error messages back complaining that the name already existed in sysobjects. I have come to find out they tool they use to create the indexes, names the index the same as exisiting table(isn't this a great idea). Other than my current problem, does anyone see other issues might run into. My thought is to drop all the indexes with the table names and recreate them with a better standard. Has anyone else ever run into or done this? THanks
View Replies !
Matching Names
My company is going to start a Cancel web site so customers can cancel their future orders by simply filling out a form. I was wondering what would be the best way to compare the cancel db to db that is used to store customer information and order information. The cancel website will only hold the name, address, and Credit Card Number used. There will not be a customer/order number. The simple Credit Card to Credit Card search will be easy but I was more worried about comparing the rest of the information in case the Credit Card search fail. I was told the "standard" look up was to take the first 3 letters of the first name and the last 3 letters of the last name. If that comes up with more then one record, take that set and see if the zip code matches up and/or part of the street address matches up (counting we do not have very reliable people inputting the information into the system is not going to help this search). Anyway, any suggestions on comparing the data would be great. Thanks ahead of time
View Replies !
Long Names
I have created a database which has a table whose name is 128 characters long; this table has a column whose name is 128 characters long. When I issue the command sp_helpconstraint table_name, SQL Server 7 returns the message "string or binary data would be truncated." Any suggestions? Thanks!
View Replies !
Proper Names
Does anyone have a simple procedure to correct all caps or all lower case to proper case e.g. BOB to Bob?
View Replies !
Table Names
Oracle provides for a table to have an alias name. Does SQL Server 7 support alias names for tables? Thanks!!
View Replies !
|