How to get server name and databases name from a server using SQL Command...

can anyone tell me
How to get server name and databases name from a server using SQL Command...

i m using sql server 2000(T-SQL)


-- "Mark As Answer" If my reply helped you --
0
patuary
7/26/2007 5:21:17 AM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

2 Replies
713 Views

Similar Articles

[PageSpeed] 21

 Use @@SERVERNAME to find the server name -
select @@SERVERNAME

& this to find the current database name -
select db_name()


M.V. 'Anil' Radhakrishna
Web Development Tips, Tricks & Trivia | My Code Gallery

Recent article - How To Create a Custom IE8 Accelerator

0
mvark
7/26/2007 7:13:22 AM

thanks..... 


-- "Mark As Answer" If my reply helped you --
0
patuary
12/25/2007 11:03:09 AM
Reply:

Similar Artilces:

This version of Microsoft Sql Server Management Studio can only be used to connect to Sql Server 2000 and Sql Server 2005 servers
When I connect SQL Server 2005 to a remote database i get the error: "This version of Microsoft Sql Server Management Studio can only be used to connect to Sql Server 2000 and Sql Server 2005 servers". Can I confirm it is because: the remote db is of SQL Server 2008? There is a soln mentioned in http://forums.asp.net/t/1324047.aspx Did anybody try this (installing 2008 express: http://www.microsoft.com/express/sql/download/)? I am just checking again, whether it will disturb my existing SQL Server installation, in any means...? Though it is mentioned that it will g...

what server name to use in SQL Server Management Tool
My hosting company is slow and incomplete in answering a question of mine, which hopefully will be generic enough to be answered here; and which I haven't found the answer to anywhere else on the Web. Question: On the SQL Server 2005 Management Express, I have no problem connecting to the database I have on my local machine. However, I need to know what to write in the "Server" textbox in the opening "Connect to Server" menu. How do you determine what it is? Thanks in advance for helping me through this mystery.  You need to write SQL Server nam...

server name for sql server
hi !!!i m using my laptop at home my machine name is "MYCOMPUTER".... when i installed sql server i try to connect to sql server in asp.net pages using vb code... but it is always give error in connection.Open()  !!!!!!!my authentication is mixed mode ........... i tried so many things i the connection string but it does not work.... "Data Source=localhost;Initial Catalog=Otters;User Id=sa;Password=karrar;"this the the example ... i also changes the localhost to MYCOMPUTER it does not work .... i tried the trusted and the not trusted connection string but still it does not work... is ...

SQL Server instance Error
Hi Guys, I created a default website in VS2008 & dragged in a webpartmanager into the div section (i was going to have a play with creating web parts). I tried to preview the default page to seeif it runs but i get the following error: Server Error in '/WebSite1' Application. 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: SQL Network Interfaces, error: 26 - E...

How to connect to Remote SQL Server database using SQL Server 2005 Express
Hi,I've an account with a hosting service provider online for SQL Server database. I've downloaded SQL Server 2005 Express from ASP.Net. How can I use it to connect to my SQL Server Database which is sitting on remote server? The hosting provider gave me following things to connect to the remote database.Server NameDatabase NameUser NamePasswordRegards,A.K.R    Anyone? I don't want to ask the obvious, but is there not a Read Me file included with the download of SQL Express which would explain how to connect? Sorry I can't be more helpful, but I've only ever briefly ...

SQL Express
Hi,I have SQL Server Express Edition. I tried working out some ASP.NET Labs in my local system. Here is the link of the Virtual Lab which I tried. http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032286906&EventCategory=3&culture=en-US&CountryCode=USI recieve this error in my local system. An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Cou...

How To Get The Database Names from a specified SQL Server ?
I m using Power Builder 6.0 as front end and SQl Server 6.5 as back end. I m trying to make an application which will compare the schema between two database. In the application I will just specify the server name and it should display all the database name in a listbox. Now, my problem is How To Get All The Database Names from a specified Server ? Sandeep. (sandeepkdas@hotmail.com) Please post in the powersoft.public.powerbuilder.database forum. This one is dedicated to Infomaker. -- Terry Dykstra (TeamSybase) Please state PB / OS / DB versions in your post. MySybase ht...

Can I use Bugzilla with Sql server 2000 or sql server 2005 as backend Database
I have Just Successfully installed Bugzilla My installation are Bugzilla 2.2 Apachec Webserver ActivePerl 7.8 Mysql 5.0 Now I like That My Database should be Sql server 2000 or sql server 2005 Can I do that [As I also see that I required some Perl module of Mysql as well] ...

How to enabel sql server notification on database as well as table using sql server 2005
HiI am ASP.NET developer. I have  implemented caching in my site.I am using "System.Web.Caching.SqlCacheDependencyAdmin.EnableNotifications("Data Source=<Data Source name>;Initial Catalog=<database name>User ID=<user id>;pwd=<password>;Pooling=true;Min Pool Size=0;Max Pool Size=1000;") & "SqlCacheDependencyAdmin.EnableTableForNotifications("Data Source=<Data Source name>;Initial Catalog=<database name>User ID=<user id>;pwd=<password>;Pooling=true;Min" Pool Size=0;Max Pool Size=1000;","<tabl...

moving an sql server 2005 database to a sql server 2000 database
I am trying to move a database which I wrote in SQL Server 2005 to a SQL Server 2000 database. I'm not sure the best way to do this....... Can anyone enlighten me?.....   this article explains it. http://searchsqlserver.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid87_gci1149585_tax301536,00.html hth,mcm pizzamaker74: I am trying to move a database which I wrote in SQL Server 2005 to a SQL Server 2000 database. I'm not sure the best way to do this....... Can anyone enlighten me?..... If both are in the same network or box just register the 2005 with the 2000 cr...

Problem with creating new SQL server database in VWDExpress using SQL Server 2005 Express
 when I try to create a SQL Database from Visual Web Developer 2005 Express Edition, I get the following error message: "Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function properly.  Please verify the installation of the component or download from the URL http://go.microsoft.com/fwlink/?LinkID=49251" When I go to that URL, it brings me to the page to download SQL Server Express 2005. any ideathanks for advance  Did you install SQL Server Express on your server/system? JeffPlease: Don't forget to click "Mark as Answe...

SQL Server Express Error: Named Pipes Provider: Could not open a connection to SQL Server [2]
HiI'm a complete sql/asp.net newbie and want to try this tutorial:http://beta.asp.net/GuidedTour/First I installed:Visual Web Developer 2005 Express Edition Beta 2systemsettings\software shows the "sql server 2005 express edition ctp (sqlexpress)" installedmmc\service shows me the SQL Server (SQLExpress) is runningFollowing the guided tour I use the commandline, type cmd, and type in the commandbox: "C:\Program Files\Microsoft SQL Server\90\Tools\binn\SQLCMD90" -S "localhost\SqlExpress"Instead of localhost I also tried computername.smallbusiness.local (thats my fully dom...

Creating a SQL Server linked server to Interbase using 64 bit SQL Server
Hi, I am trying to use the data direct odbc driver for interbase to create a linked server in SQL Server 2008 R2 64bit however, SQL Server reports an "Arcitechure Mismatch" between the System DSN and SQL Server. This did work under 32 bit SQL Server. Is there a 64bit specific odbc driver for interbase? I have tried using the IBProvider trial as well but this fails to work in SQL Server as well. Our Interbase client(s) and server are all 64 bit installations. Thank you Julian Dawson wrote: > Is there a 64bit specific odbc driver for interbase? I think Easy...

SQl Server Error: ----> Named Pipes Provider, error: 40
  Hi Friends, Im using .Net2008 and MS SQL Server2005, I Have a web application , i want to connect to the server machine SQL Server,  When i run the application im getting the following error. Im trying to connect to the database from local machine application to server machine database   An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Cou...

Web resources about - How to get server name and databases name from a server using SQL Command... - asp.net.sql-datasource

Database - Wikipedia, the free encyclopedia
... requiring information. For example, modelling the availability of rooms in hotels in a way that supports finding a hotel with vacancies. Database ...

Database - Wikipedia, the free encyclopedia
A database is an organized collection of data . The data are typically organized to model aspects of reality in a way that supports processes ...

ACT government raises serious privacy concerns over facial recognition database
The ACT government has expressed serious concerns about a new database that would give unprecedented&nbsp;powers to police.

Athena Database Pushes Ad Boundaries for Best Buy
... The back-to-school season marked the first time Best Buy tested the prowess of its Athena project in digital media campaigns. The database ...

Donald Trump is not ruling out using databases to track Muslims
CBS News Donald Trump is not ruling out using databases to track Muslims CBS News NEWTON, Iowa Republican presidential candidate Donald Trump ...

Trump would 'certainly implement' national database for US Muslims
CNN Trump would 'certainly implement' national database for US Muslims CNN Washington (CNN) Donald Trump on Thursday called for the creation ...

For many Oracle database users, Dec. 1 deadline looms
Companies that use a standard edition of Oracle's database software should be aware that a rapidly approaching deadline could mean increased ...

Report: VW Failed To Disclose One Death, Three Injuries To Federal Regulator Database
... manufacturers to report death and injury claims to the National Highway Traffic Safety Administration. A new analysis of the regulator’s database ...

Hackers have infiltrated the US arrest records database
Earlier this year, a hacking group broke into the personal email account of CIA director John Brenner and published a host of sensitive attachments ...

Microsoft Azure Welcomes MariaDB Open-Source Database
Though eclipsed by the historic Red Hat deal, other major new developments affected Microsoft Azure cloud's database ecosystem this week.

resources last updated: 11/20/2015 12:32:47 PM