Click here to Skip to main content
15,915,019 members
Home / Discussions / Database
   

Database

 
QuestionDrop Constraints in Oracle SQLPLUS Pin
M Riaz Bashir11-Jan-09 21:11
M Riaz Bashir11-Jan-09 21:11 
AnswerRe: Drop Constraints in Oracle SQLPLUS Pin
Wendelius12-Jan-09 2:31
mentorWendelius12-Jan-09 2:31 
QuestionReset autonumber (ID) in SQL Server Pin
Matjaz-xyz11-Jan-09 19:53
Matjaz-xyz11-Jan-09 19:53 
AnswerRe: Reset autonumber (ID) in SQL Server Pin
Matjaz-xyz11-Jan-09 20:31
Matjaz-xyz11-Jan-09 20:31 
Questionsql connection error Pin
staticv11-Jan-09 8:01
staticv11-Jan-09 8:01 
AnswerRe: sql connection error Pin
Wendelius11-Jan-09 10:28
mentorWendelius11-Jan-09 10:28 
GeneralRe: sql connection error Pin
staticv12-Jan-09 0:23
staticv12-Jan-09 0:23 
GeneralRe: sql connection error Pin
Wendelius12-Jan-09 3:36
mentorWendelius12-Jan-09 3:36 
The confusing part was the connection strings and how different they were:

manzoor10 wrote:
// SQL Server authentication
connection->ConnectionString =
"User ID=sa; Password=;"
"Data Source=(local); Initial Catalog=DCV_DB;";

The above means that you connect to a default instance and use a database named DCV_DB, which is running all the time.

manzoor10 wrote:
// Windows Integrated Security
connection->ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\DCV_DB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True";


This again means that you connect to a named instance (SQLEXPRESS) on local host and when connecting a database is attached to the SQL Server instance. So the database available only on the instance when this connection exists. Also since the database is located under C:\Program Files\Microsoft SQL Server\MSSQL.1, it gives the impression that the database is designed to be available in the SQL Server all the time.

In many cases database files that are attached to an instance while connecting to it, are not located under that folder (although there's nothing wrong technically). This is because attached db files usually ship as plain files with a product and the product installation may not necessary modify files under a different installation (SQL Server in this case).


manzoor10 wrote:
By the way how do you manually copy a database from one PC to another


In many cases it's done by:
- creating a backup on the source and then restoring a backup on target or
- detaching a database on source, copy files to target and then attach the files to the target instance
Currently you do the attaching phase every time you connect but it can also be done only once and then you just use the database.

manzoor10 wrote:
Anyways the problem is solved


That's the most important thing.

manzoor10 wrote:
Thanks


You're welcome.

The need to optimize rises from a bad design.My articles[^]

AnswerRe: sql connection error Pin
Henry Minute11-Jan-09 10:35
Henry Minute11-Jan-09 10:35 
QuestionInstall SQL Server on Vista Pin
George_George11-Jan-09 2:41
George_George11-Jan-09 2:41 
AnswerRe: Install SQL Server on Vista Pin
Wendelius11-Jan-09 3:05
mentorWendelius11-Jan-09 3:05 
GeneralRe: Install SQL Server on Vista Pin
George_George12-Jan-09 0:21
George_George12-Jan-09 0:21 
GeneralRe: Install SQL Server on Vista Pin
Wendelius12-Jan-09 2:26
mentorWendelius12-Jan-09 2:26 
AnswerRe: Install SQL Server on Vista Pin
Colin Angus Mackay11-Jan-09 3:20
Colin Angus Mackay11-Jan-09 3:20 
GeneralRe: Install SQL Server on Vista Pin
George_George12-Jan-09 0:24
George_George12-Jan-09 0:24 
AnswerRe: Install SQL Server on Vista Pin
Hamid_RT15-Jan-09 2:26
Hamid_RT15-Jan-09 2:26 
GeneralRe: Install SQL Server on Vista Pin
George_George15-Jan-09 18:36
George_George15-Jan-09 18:36 
Questionis there the sql syntex Limit in MS SQL? Pin
neodeaths11-Jan-09 0:44
neodeaths11-Jan-09 0:44 
AnswerRe: is there the sql syntex Limit in MS SQL? Pin
Reza Raad11-Jan-09 1:09
Reza Raad11-Jan-09 1:09 
Questionhow do i make a special sql statment filter? Pin
neodeaths10-Jan-09 22:55
neodeaths10-Jan-09 22:55 
AnswerRe: how do i make a special sql statment filter? [modified] Pin
Wendelius10-Jan-09 23:10
mentorWendelius10-Jan-09 23:10 
GeneralRe: how do i make a special sql statment filter? Pin
neodeaths11-Jan-09 0:43
neodeaths11-Jan-09 0:43 
QuestionWTL/ATL Pin
manosza10-Jan-09 21:21
manosza10-Jan-09 21:21 
AnswerRe: WTL/ATL Pin
Wendelius10-Jan-09 21:58
mentorWendelius10-Jan-09 21:58 
QuestionUpdating table based on search critea from two tables. Pin
Sunset Towers10-Jan-09 1:54
Sunset Towers10-Jan-09 1:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.