Difference between SQL connection string (local) and .\ - sql

Between SQL 2000 and 2005 MS changed the syntax to connect to a local database from (local) to .\instanceName.
I have a client who has been using (local)\instanceName to connect to local SQL Server 2005 databases. Usually it works fine, but sometimes it doesn't and he has been using PCname\instanceName.
Why does this sometimes fail?

You can define alias for your instance in sql server configuration manager. You can define multiple aliases for same instace, so both (loacl) and instanceName will work.

Related

Generate an "INSERT INTO" script from SQL Server to Postgres

I need to generate a script with the data from one db in sql server to postgres. It seems the "Generate Script" in SQL Management doesn't do ANSI format like INSERT INTO that I need.
How can I do it?
I suggest.
Fire up an instance of Postgres on an accessible device.
Set up a linked server from Microsoft SQL Server to access the postgresql server using the postgres 64 bit odbc driver.
Start writing TSQL to transfer the data.
https://www.google.com.au/search?q=postgresql+odbc+sql+server+2012

Moving a Compability Level 80 db under SQL Server 2005 instance to SQL Server 2000 Instance (by not using db script)

I have a database with the compatibility level 80. However, it is on a SQL Server 2005 Instance.
I need to move that database to SQL Server 2000 Instance.
I can not use the script of db because it contains lots of linked server, missing objects, same server db references which is painful to handle.
How can I move db to SQL Server 2000 without using dbscript?

How to retrieve records from server database into local database

I have a little problem. I want to create a query in my local database (tijdsregistratie.mdf) to retrieve rows from my server database (IT Solutions Develop.dbo) on server itshou-dev03\sql2008.
But I don't know how to connect to the server database. I tried it like this :
select TOP 10 * from [IT Solutions Develop].dbo.[IT Solutions BVBA$Planning]
.. but it gives me this error :
Invalid object name 'IT Solutions Develop.dbo.IT Solutions
BVBA$Planning'.
One way is to link the servers:
http://msdn.microsoft.com/en-us/library/ms188279.aspx?ppud=4
You can also define linked servers by using SQL Server Management
Studio. In the Object Explorer, right-click Server Objects, select
New, and select Linked Server. You can delete a linked server
definition by right-clicking the linked server name and selecting
Delete.
This is the process by which you tell SQL Server where another server is and how to connect to it. You can do this in SQL Server Management Studio or in T-SQL. You can then refer to the linked server by a four part name (similar to what is in your question):
[LinkedServerName].[Database].[Schema].[Object]

SQL Server 2000 sp? odbc vs OleDb

Our clients wnat us to retreive data from SQL Server 2000. It is unknown whether they have any service packs installed for that SQL Server. Assuming the worst (no sp), will there be a problem using OleDb driver to work with SQL Server 2000?
OleDb is working fine without any sp.

SQL Server 2005 query multiple Access databases?

Is there a way to get SQL Server 2005 to query 3 or more separate Access databases (each returning 1 record) in one SQL statement?
Yes, but it will require you to create a Linked Server instance for each Access database. See here for details about creating Linked Server instances on SQL Server 2005 to MS Access.
Once you have those in place, you can query SQL Server and it will pass on the queries to the respective Access databases based on using the Linked Server instance notation when specifying tables in your SQL Server queries.
What you want is a Linked Server for each of the Access databases.
Just be aware that in SQL 2005 64-bit you won't be querying current versions of Access or Excel through linked servers any time soon.
Yes, set them up as linked servers using sp_addlinkedserver.