Showing posts with label file. Show all posts
Showing posts with label file. Show all posts

Friday, March 30, 2012

New to SQL and need help

I am running a program that was created in VB that takes data from a
scanned file and inserts it into our database. We have the column
student id as the primary key and it is decremented every time it goes
through the program so they are each unique and never overlap. The
program has been working fine but recently when I run it I get a
primary key violation. I thought that the identity might have gotten
out of sync and tried CheckIdent but still no luck. I came to find
out that the primary key does not have an identity and so I am not
sure why it will not let me insert the data.It is just that the value you are trying to insert already exists.

--
Posted via http://dbforums.com|||I've looked at the table that I am trying to insert into and did a query
for numbers that overlapped and it returned nothing.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||Hightower130 (bowens@.webebi.com) writes:
> I am running a program that was created in VB that takes data from a
> scanned file and inserts it into our database. We have the column
> student id as the primary key and it is decremented every time it goes
> through the program so they are each unique and never overlap. The
> program has been working fine but recently when I run it I get a
> primary key violation. I thought that the identity might have gotten
> out of sync and tried CheckIdent but still no luck. I came to find
> out that the primary key does not have an identity and so I am not
> sure why it will not let me insert the data.

And since I don't see your database, your input file, your VB code etc,
neither can I tell what went wrong.

It is possible that if you posted some code that it would help, but
since you have the existing data, and the problem appears to be
reproducible - how about debugging it?

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Wednesday, March 28, 2012

new tempdb file shrinking

since the tempdb file was growing to large I created a new one on another
drive; now that file is getting to large; I need to shrink it. both the
original "tempdev" file and the new one "tempdb_1_data" are in the PRIMARY
group but the "tempdev" is locked to 1 MB while "tempdb_1_data" is now 36GB
and growing. only about 1GB of the 36GB is used.
remember i don't want to shrink the original sql server created temp file
"tempdev"
can I use dbcc shrinkfile (tempdb_1_data, 2000) without a problem? and
without having to restart the sql service?
http://www.aspfaq.com/2446
http://www.aspfaq.com/2471
http://www.aspfaq.com/
(Reverse address to reply.)
"Peter L." <Peter L.@.discussions.microsoft.com> wrote in message
news:8FD556CF-ED9A-41BD-80EA-6C5E604EEEBB@.microsoft.com...
> since the tempdb file was growing to large I created a new one on another
> drive; now that file is getting to large; I need to shrink it. both the
> original "tempdev" file and the new one "tempdb_1_data" are in the PRIMARY
> group but the "tempdev" is locked to 1 MB while "tempdb_1_data" is now
36GB
> and growing. only about 1GB of the 36GB is used.
> remember i don't want to shrink the original sql server created temp file
> "tempdev"
> can I use dbcc shrinkfile (tempdb_1_data, 2000) without a problem? and
> without having to restart the sql service?

new tempdb file shrinking

since the tempdb file was growing to large I created a new one on another
drive; now that file is getting to large; I need to shrink it. both the
original "tempdev" file and the new one "tempdb_1_data" are in the PRIMARY
group but the "tempdev" is locked to 1 MB while "tempdb_1_data" is now 36GB
and growing. only about 1GB of the 36GB is used.
remember i don't want to shrink the original sql server created temp file
"tempdev"
can I use dbcc shrinkfile (tempdb_1_data, 2000) without a problem? and
without having to restart the sql service?http://www.aspfaq.com/2446
http://www.aspfaq.com/2471
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Peter L." <Peter L.@.discussions.microsoft.com> wrote in message
news:8FD556CF-ED9A-41BD-80EA-6C5E604EEEBB@.microsoft.com...
> since the tempdb file was growing to large I created a new one on another
> drive; now that file is getting to large; I need to shrink it. both the
> original "tempdev" file and the new one "tempdb_1_data" are in the PRIMARY
> group but the "tempdev" is locked to 1 MB while "tempdb_1_data" is now
36GB
> and growing. only about 1GB of the 36GB is used.
> remember i don't want to shrink the original sql server created temp file
> "tempdev"
> can I use dbcc shrinkfile (tempdb_1_data, 2000) without a problem? and
> without having to restart the sql service?

new tempdb file shrinking

since the tempdb file was growing to large I created a new one on another
drive; now that file is getting to large; I need to shrink it. both the
original "tempdev" file and the new one "tempdb_1_data" are in the PRIMARY
group but the "tempdev" is locked to 1 MB while "tempdb_1_data" is now 36GB
and growing. only about 1GB of the 36GB is used.
remember i don't want to shrink the original sql server created temp file
"tempdev"
can I use dbcc shrinkfile (tempdb_1_data, 2000) without a problem? and
without having to restart the sql service?http://www.aspfaq.com/2446
http://www.aspfaq.com/2471
http://www.aspfaq.com/
(Reverse address to reply.)
"Peter L." <Peter L.@.discussions.microsoft.com> wrote in message
news:8FD556CF-ED9A-41BD-80EA-6C5E604EEEBB@.microsoft.com...
> since the tempdb file was growing to large I created a new one on another
> drive; now that file is getting to large; I need to shrink it. both the
> original "tempdev" file and the new one "tempdb_1_data" are in the PRIMARY
> group but the "tempdev" is locked to 1 MB while "tempdb_1_data" is now
36GB
> and growing. only about 1GB of the 36GB is used.
> remember i don't want to shrink the original sql server created temp file
> "tempdev"
> can I use dbcc shrinkfile (tempdb_1_data, 2000) without a problem? and
> without having to restart the sql service?sql

new tables everyday

We have a software package that exports its data in MS Access 97 and 2000
formats. It overwrites and creates a new Access file each time it exports.
These exports serve a handful of front end applications. I'd like to get
this data tied to our SQL 2005 server. Any suggestions on whether to look at
just linking these in vs importing, etc?Hi,
Are you using the data imported just to query against it from an application
that connects to SQL Server? In that case you can indeed avoid the hassle
of importing by setting up linked servers (see
http://msdn2.microsoft.com/en-us/library/ms190479.aspx). This will allow
you to access your data over connections to the SQL Server using a four part
object name i.e. linkedservername.database.schema.table. You can also use
functions like OPENROWSET and OPENDATASOURCE, but if you access the external
data in various places in your code then I would suggest that you use linked
servers instead.
Jonathan
"Schmeg" <sschmeg@.yahoo.com> wrote in message
news:OE54Ig14HHA.1484@.TK2MSFTNGP06.phx.gbl...
> We have a software package that exports its data in MS Access 97 and 2000
> formats. It overwrites and creates a new Access file each time it exports.
> These exports serve a handful of front end applications. I'd like to get
> this data tied to our SQL 2005 server. Any suggestions on whether to look
> at just linking these in vs importing, etc?
>|||On Aug 20, 11:31 am, "Schmeg" <ssch...@.yahoo.com> wrote:
> We have a software package that exports its data in MS Access 97 and 2000
> formats. It overwrites and creates a new Access file each time it exports.
> These exports serve a handful of front end applications. I'd like to get
> this data tied to our SQL 2005 server. Any suggestions on whether to look at
> just linking these in vs importing, etc?
Why do you export the data to Access? Is it for off line use or just
because? I support multipule Access Projects that connect directly to
MS SQL server and they have thousands of lines of code for working
with the data. This works well and is good for rappid development.
On the other hand if you only want a couple of the tables in the SQL
DB available for the users to work in then link the tables in access.

Monday, March 26, 2012

New SQLXMLBulkLoad user--having problems

I am trying, for the first time to load an xml file into SQL Server 2000, and to get me going I am trying to execute the msdn example:-

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlxml3/htm/bulkload_6bos.asp

I have configured all the needed set up and keep getting this error:-

Automation error(80040e21)

With no real error info in the error log

The Connection string details are all correct..I have checked that

The error occurs at line:-

objBL.Execute "SampleSchema.xml", "SampleXMLData.xml"

Have you got any ideas…?

Has anyone actually managed to run this example without errors?


Appreciate your help

Thanks

Raj

Hello,

Send me the schema and the data file and I will try a repro.

Regards,

Monica

sql

New SQLXMLBulkLoad user--having problems

I am trying, for the first time to load an xml file into SQL Server 2000, and to get me going I am trying to execute the msdn example:-

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlxml3/htm/bulkload_6bos.asp

I have configured all the needed set up and keep getting this error:-

Automation error(80040e21)

With no real error info in the error log

The Connection string details are all correct..I have checked that

The error occurs at line:-

objBL.Execute "SampleSchema.xml", "SampleXMLData.xml"

Have you got any ideas…?

Has anyone actually managed to run this example without errors?


Appreciate your help

Thanks

Raj

Hello,

Send me the schema and the data file and I will try a repro.

Regards,

Monica

Wednesday, March 21, 2012

New Server, How to transfer data from old server?

I'm using SQLServer 2000 on Windows 2000 Server.
We have just purchased a new server. The new server will
have the EXACT same file structure, computer name, and
static IP address as the old server. (We DO NOT use
replication).
I want transfer my databases, DTSs, and Logins to the new
server from the old.
How do I so this?
Do I only need to transfer the User databases or must I
also transfer the Master, Model, Tempdb, and msdb system
databases?
Thanksmaster contains the logins which will be needed on the new server...
You could backup/restore master, and msdb...
You could could the copy database wizard to copy the rest...
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Brent Murphy" <brent.murphy@.us.schneider-electric.com> wrote in message
news:031d01c3af99$64620b70$a101280a@.phx.gbl...
> I'm using SQLServer 2000 on Windows 2000 Server.
> We have just purchased a new server. The new server will
> have the EXACT same file structure, computer name, and
> static IP address as the old server. (We DO NOT use
> replication).
> I want transfer my databases, DTSs, and Logins to the new
> server from the old.
> How do I so this?
> Do I only need to transfer the User databases or must I
> also transfer the Master, Model, Tempdb, and msdb system
> databases?
> Thanks
>|||Thanks Wayne.
So my Backed up Master DB will just overwrite whatever
Master DB is on the new server from the SQL Server 2000
install?
>--Original Message--
>master contains the logins which will be needed on the
new server...
>You could backup/restore master, and msdb...
>You could could the copy database wizard to copy the
rest...
>
>--
>Wayne Snyder, MCDBA, SQL Server MVP
>Computer Education Services Corporation (CESC),
Charlotte, NC
>www.computeredservices.com
>(Please respond only to the newsgroups.)
>I support the Professional Association of SQL Server
(PASS) and it's
>community of SQL Server professionals.
>www.sqlpass.org
>"Brent Murphy" <brent.murphy@.us.schneider-electric.com>
wrote in message
>news:031d01c3af99$64620b70$a101280a@.phx.gbl...
>> I'm using SQLServer 2000 on Windows 2000 Server.
>> We have just purchased a new server. The new server
will
>> have the EXACT same file structure, computer name, and
>> static IP address as the old server. (We DO NOT use
>> replication).
>> I want transfer my databases, DTSs, and Logins to the
new
>> server from the old.
>> How do I so this?
>> Do I only need to transfer the User databases or must I
>> also transfer the Master, Model, Tempdb, and msdb system
>> databases?
>> Thanks
>
>.
>|||Moving SQL Server Databases
http://www.support.microsoft.com/?id=224071
Moving Databases between Servers
http://www.support.microsoft.com/?id=314546
Using WITH MOVE in a Restore to a New Location with Detach/Attach
http://support.microsoft.com/?id=221465
How To Transfer Logins and Passwords Between SQL Servers
http://www.support.microsoft.com/?id=246133
Mapping Logins & SIDs after a Restore
http://www.support.microsoft.com/?id=298897
Utility to map users to the correct login
http://www.dbmaint.com/SyncSqlLogins.asp
How to Resolve Permission Issues When a Database Is Moved Between SQL Servers
http://www.support.microsoft.com/?id=240872
User Logon and/or Permission Errors After Restoring Dump
http://www.support.microsoft.com/?id=168001
Disaster Recovery Articles for SQL Server
http://www.support.microsoft.com/?id=307775
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Brent Murphy" <brent.murphy@.us.schneider-electric.com> wrote in message
news:031d01c3af99$64620b70$a101280a@.phx.gbl...
> I'm using SQLServer 2000 on Windows 2000 Server.
> We have just purchased a new server. The new server will
> have the EXACT same file structure, computer name, and
> static IP address as the old server. (We DO NOT use
> replication).
> I want transfer my databases, DTSs, and Logins to the new
> server from the old.
> How do I so this?
> Do I only need to transfer the User databases or must I
> also transfer the Master, Model, Tempdb, and msdb system
> databases?
> Thanks
>|||One approach that we have used:
Stop sql services (disable) on old SQL server, rename that
server and re-ip it to something temporary.
Name new server and IP it to it's production name/ip.
Install SQL 2000 on it maintaining the exact file
structure of the original.
Apply whatever SP's / hotfixes to get SQL / W2k versions
to match across old box / new box.
Stop all SQL services on new box. Rename the folders
where your mdf's and ldf's are stored.
Copy the folders with the mdf's and ldf's from the
original server to the new server.
Start the services and go into enterprise mgr. and make
sure that all of the DB's are online.
This process will transfer all db's, logins, etc. We have
used it many times. The key is to have the file structure
match exactly as you mentioned. (and sp's)
You will have to recreate any scheduled tasks / maint
plans using this approach. Or you can probably copy them
also by moving the whole mssql folders instead of just
those that contain the data/log files. We haven't tried
this, but it should work.
HTH, Chuck
>--Original Message--
>I'm using SQLServer 2000 on Windows 2000 Server.
>We have just purchased a new server. The new server will
>have the EXACT same file structure, computer name, and
>static IP address as the old server. (We DO NOT use
>replication).
>I want transfer my databases, DTSs, and Logins to the new
>server from the old.
>How do I so this?
>Do I only need to transfer the User databases or must I
>also transfer the Master, Model, Tempdb, and msdb system
>databases?
>Thanks
>.
>|||Thanks Chuck for the informative answer!
I have a question. You said "Stop all SQL services on new
box. Rename the folders where your mdf's and ldf's are
stored."
If I have the same file/folder structure on the new
server, why do I need to rename the folders? I didn't
under stand that part. Is it just so you don't copy over
whatever was put in the orignal folders from the install?
>--Original Message--
>One approach that we have used:
>Stop sql services (disable) on old SQL server, rename
that
>server and re-ip it to something temporary.
>Name new server and IP it to it's production name/ip.
>Install SQL 2000 on it maintaining the exact file
>structure of the original.
>Apply whatever SP's / hotfixes to get SQL / W2k versions
>to match across old box / new box.
>Stop all SQL services on new box. Rename the folders
>where your mdf's and ldf's are stored.
>Copy the folders with the mdf's and ldf's from the
>original server to the new server.
>Start the services and go into enterprise mgr. and make
>sure that all of the DB's are online.
>This process will transfer all db's, logins, etc. We
have
>used it many times. The key is to have the file
structure
>match exactly as you mentioned. (and sp's)
>You will have to recreate any scheduled tasks / maint
>plans using this approach. Or you can probably copy them
>also by moving the whole mssql folders instead of just
>those that contain the data/log files. We haven't tried
>this, but it should work.
>HTH, Chuck
>>--Original Message--
>>I'm using SQLServer 2000 on Windows 2000 Server.
>>We have just purchased a new server. The new server
will
>>have the EXACT same file structure, computer name, and
>>static IP address as the old server. (We DO NOT use
>>replication).
>>I want transfer my databases, DTSs, and Logins to the
new
>>server from the old.
>>How do I so this?
>>Do I only need to transfer the User databases or must I
>>also transfer the Master, Model, Tempdb, and msdb system
>>databases?
>>Thanks
>>.
>.
>|||Sorry took so long for me to get back.. You've probably already
figured this out, but the goal was to rename the data folders on the
new install in case anything went sideways when you copied the data
folders from the original install, so you can go back. Good luck!
Chuck
"Brent Murphy" <brent.murphy@.us.schneier-electric.com> wrote in message news:<0bc201c3b035$e1c4eb40$a101280a@.phx.gbl>...
> Thanks Chuck for the informative answer!
> I have a question. You said "Stop all SQL services on new
> box. Rename the folders where your mdf's and ldf's are
> stored."
> If I have the same file/folder structure on the new
> server, why do I need to rename the folders? I didn't
> under stand that part. Is it just so you don't copy over
> whatever was put in the orignal folders from the install?
>

Saturday, February 25, 2012

New Guy Question: Which came first ... the chicken or the checkpoint file?

Hello all...here's a question from a newbie ...

I'm attempting to configure my SSIS package to use a checkpoint file. I've checked the docs, and I believe I've set all the package properties for this ... except they are looking for the name of the checkpoint file. I've tried a couple of experiments such as c:\myCheckpoint.txt and c:\myCheckpoint.xml ... just for grins ... to see if SSIS would generate a checkpoint file for me at the start of the package ... no luck:

Message: Checkpoint file "C:\myCheckpoint.xml" failed to open due to error
0x80070002 "The system cannot find the file specified.".

From these runtime errors I've seen, it appears the checkpoint file should be an XML file that is created w/ specific nodes, etc. My question is ... how do I create the checkpoint file in advance so that when the package is executed it will find it and run?

SSIS ... pretty cool stuff!

Thanks!This is controlled by Package.CheckpointUsage property.
You probably have it set to 'Always' which causes package
to require the checkpoint file. You need to set it to 'IfExists' -
then the checkpoint file will be used if it exists.|||Yeah, that's what I figured too. The property options are Always, IfExists and Never. The doc doesn't specify that a file is created for you if you use Always, and on practical experimentation this didn't seem to help. Perhaps there's another property I missed; I did try to follow all the Package property settings that appeared to relate to checkpoints.

Thank you very much for trying!

DB|||The checkpoint is created automatically when the package fails (if it is configured to use checkpoints).

When you set CheckpointUsage=Always, you tell package that it has to start from previously saved checkpoint, i.e. the checkpoint file is expected to exist.

If you don't have checkpoint file yet, set CheckpointUsage=IfExists and run the package. It will run fine, and if it fails the package will create a checkpoint file. Next time when you run this package it will use that checkpoint.|||Thank you very, very much for your help! That makes sense!

Doug|||

Being another newbe, this post has been exceedingly helpful - I ran into the same issue!

Thanks! :-)

New Guy Question: Which came first ... the chicken or the checkpoint file?

Hello all...here's a question from a newbie ...

I'm attempting to configure my SSIS package to use a checkpoint file. I've checked the docs, and I believe I've set all the package properties for this ... except they are looking for the name of the checkpoint file. I've tried a couple of experiments such as c:\myCheckpoint.txt and c:\myCheckpoint.xml ... just for grins ... to see if SSIS would generate a checkpoint file for me at the start of the package ... no luck:

Message: Checkpoint file "C:\myCheckpoint.xml" failed to open due to error
0x80070002 "The system cannot find the file specified.".

From these runtime errors I've seen, it appears the checkpoint file should be an XML file that is created w/ specific nodes, etc. My question is ... how do I create the checkpoint file in advance so that when the package is executed it will find it and run?

SSIS ... pretty cool stuff!

Thanks!This is controlled by Package.CheckpointUsage property.
You probably have it set to 'Always' which causes package
to require the checkpoint file. You need to set it to 'IfExists' -
then the checkpoint file will be used if it exists.|||Yeah, that's what I figured too. The property options are Always, IfExists and Never. The doc doesn't specify that a file is created for you if you use Always, and on practical experimentation this didn't seem to help. Perhaps there's another property I missed; I did try to follow all the Package property settings that appeared to relate to checkpoints.

Thank you very much for trying!

DB|||The checkpoint is created automatically when the package fails (if it is configured to use checkpoints).

When you set CheckpointUsage=Always, you tell package that it has to start from previously saved checkpoint, i.e. the checkpoint file is expected to exist.

If you don't have checkpoint file yet, set CheckpointUsage=IfExists and run the package. It will run fine, and if it fails the package will create a checkpoint file. Next time when you run this package it will use that checkpoint.|||Thank you very, very much for your help! That makes sense!

Doug|||

Being another newbe, this post has been exceedingly helpful - I ran into the same issue!

Thanks! :-)

New file notification

Hi All,

I am vey new to NS and here is what I am trying to achive:

User creates/copies over a file on the network. When this happens, I want to start an existing Job (SQL stored procedure) in SQL Server Agent.

Any lead (existing sample applications etc.) for me to start is apprecitated.

Thank you.

You can make use of the inbuilt "Event Provider" that monitors a specific folder. For more information, read about "Event Providers"|||Is this for some kind of ETL process? I'm not sure that SSNS is the best tool available for you here.

If you believe that it is the best tools, consider these options:

SSNS does come with a FileSystemWatcher event provider, but it looks for a valid XML document in the watched folder. If you're files are something besides a valid XML document, you can create a custom event provider using any .NET Framework language.

SSNS is designed to deliver notifications rather than start processes. So, you would need to create a custom delivery channel to start your SQL Server Agent process.

HTH...

Joe|||

Thank you Ragas. I looked at some online examples and worked it out. This article was quite helpfull:

http://www.devx.com/dbzone/Article/28522

|||

Thank you Joe. Yes, it is an ETL process and SSNS works pretty well. I downloaded this example and figured it out eventually: http://www.devx.com/dbzone/Article/28522

I added a trigger to start my SQL Agent job on one of the Notification Application tables when a new notification record is created.

AE

|||That's great, AE.

Is there anything that you could share with the group?

Thanks!

Joe|||

No Joe, just the link I provided for a good sample application in my previous message.

Ahmet

New file notification

Hi All,

I am vey new to NS and here is what I am trying to achive:

User creates/copies over a file on the network. When this happens, I want to start an existing Job (SQL stored procedure) in SQL Server Agent.

Any lead (existing sample applications etc.) for me to start is apprecitated.

Thank you.

You can make use of the inbuilt "Event Provider" that monitors a specific folder. For more information, read about "Event Providers"|||Is this for some kind of ETL process? I'm not sure that SSNS is the best tool available for you here.

If you believe that it is the best tools, consider these options:

SSNS does come with a FileSystemWatcher event provider, but it looks for a valid XML document in the watched folder. If you're files are something besides a valid XML document, you can create a custom event provider using any .NET Framework language.

SSNS is designed to deliver notifications rather than start processes. So, you would need to create a custom delivery channel to start your SQL Server Agent process.

HTH...

Joe|||

Thank you Ragas. I looked at some online examples and worked it out. This article was quite helpfull:

http://www.devx.com/dbzone/Article/28522

|||

Thank you Joe. Yes, it is an ETL process and SSNS works pretty well. I downloaded this example and figured it out eventually: http://www.devx.com/dbzone/Article/28522

I added a trigger to start my SQL Agent job on one of the Notification Application tables when a new notification record is created.

AE

|||That's great, AE.

Is there anything that you could share with the group?

Thanks!

Joe|||

No Joe, just the link I provided for a good sample application in my previous message.

Ahmet

Monday, February 20, 2012

New database from backup

I am going to build a new website and I have all the data in a sql-backup file - and I have a new installation of SQL Server - how do I install it? I try to use Restore database from SQL Server Manager, but I just get the errors (I think because of that I do not have the database in the server).

I am totally beginner with SQL Server - so coudl anyone help me?

What errors are you getting, exactly?

If you want to restore the database on a second machine (instead of the one where the backup was made), you probably need to modify the path where the files will be stored. On the restore database dialog, go to the second tab and check the file names. (This is in SQL 2000 Enterprise Manager, the dialog may look different on the 2005 version).|||Thanks.
You made my day.

New database file locations

Hi. Could anyone suggest why, whenever a third-party application that creates
and uses its own SQL Server database, it creates the physical files in a
location that is not the default? This doesn't seem to be an app-specific
issue as different apps have done the same thing.
As per the general advise data and log files on my system are held on
separate volumes and when I create a new database myself the physical files
are created in their default locations. However this is not the case with
third-party apps. They seem to be creating the files in the same volume. How
do I change this behavior. I had thought that the settings of the model
database would determine where those files would go?
YaHozna.Hello,
I feel that your third party application creates the database specifying the
path. In this case the database will be created based on the path specified
in CREATE DATABASE command. Incase if the path is not configurab,e in
application installlation, you could detach the database, copy the files
to required drive and folder and attach the database. See SP_DETACH_DB and
SP_ATTACH_DB in books online..
Thanks
Hari
"YaHozna" <YaHozna@.discussions.microsoft.com> wrote in message
news:A74E91B5-7CDC-4143-ADFE-EF814499DE0B@.microsoft.com...
> Hi. Could anyone suggest why, whenever a third-party application that
> creates
> and uses its own SQL Server database, it creates the physical files in a
> location that is not the default? This doesn't seem to be an app-specific
> issue as different apps have done the same thing.
> As per the general advise data and log files on my system are held on
> separate volumes and when I create a new database myself the physical
> files
> are created in their default locations. However this is not the case with
> third-party apps. They seem to be creating the files in the same volume.
> How
> do I change this behavior. I had thought that the settings of the model
> database would determine where those files would go?
> YaHozna.|||There is a server setting that determines the default location for the data
and log files, not hte master db. Check the properties of the server in
Enterprise Manager and you will find them.
--
Andrew J. Kelly SQL MVP
"YaHozna" <YaHozna@.discussions.microsoft.com> wrote in message
news:A74E91B5-7CDC-4143-ADFE-EF814499DE0B@.microsoft.com...
> Hi. Could anyone suggest why, whenever a third-party application that
> creates
> and uses its own SQL Server database, it creates the physical files in a
> location that is not the default? This doesn't seem to be an app-specific
> issue as different apps have done the same thing.
> As per the general advise data and log files on my system are held on
> separate volumes and when I create a new database myself the physical
> files
> are created in their default locations. However this is not the case with
> third-party apps. They seem to be creating the files in the same volume.
> How
> do I change this behavior. I had thought that the settings of the model
> database would determine where those files would go?
> YaHozna.|||Many 3rd party applications do this, unfortunately.
When CREATE DATABASE is used without options, the defaults are
taken from the model database, but it is perfectly possible to
override the defaults by using the NAME and FILENAME options with
the CREATE DATABASE statement.
You can change the location of the files after the installation.
From http://sql.veranoest.net/sql_faq.htm
Q. How can I move my database files to another disk in my SQL
Server?
A. An easy way to move user database files to a different location
is by detaching, moving and attaching the user database.
This can be done in SQL Server Management Studio so you don't have
to type any code.
Here are the steps:
1. Start SQL Server Management Studio
2. Expand the server instance, expand Databases
3. right-click the database you want to move, and choose
"Properties"
4. In the Properties window, choose "Files" and write down the
current file paths. Click "Cancel"
5. right-click the database again, and choose "Tasks - Detach..."
6. click "OK" in the next window
7. Use Windows Explorer to move the data and log files (.mdf and
.ldf) to the new location
8. right-click Databases, and choose "Attach..."
9. In the "Attach databases" window, click "Add"
10.In the "Locate database files" window, browse to the new
location and select the .mdf file. Click "OK"
11.In the details pane, verify that the new location is listed for
both the .mdf and the .ldf file. Click "OK"
12.In SQL Server Management Studio, choose "View - Refresh" and
verify that your database is listed again under Databases
Alternatively you can backup the database and restore it,
specifying a different location for the files on the options table
or use the MOVE clause in the RESTORE command in Transact-SQL.
Details are here:
221465 - INF: Using the WITH MOVE Option with the RESTORE Statement
http://support.microsoft.com/?kbid=221465
If you want to move the system databases, be sure to read these
articles:
Moving the SQL 2005 System Databases
http://www.sqlservercentral.com/columnists/vIacoboni/2605.asp
224071 - How to move SQL Server databases to a new location by
using Detach and Attach functions in SQL Server
http://support.microsoft.com/?kbid=224071
_________________________________________________________
Vera Noest
MCSE, CCEA, Microsoft MVP - Terminal Server
SQL troubleshooting: http://sql.veranoest.net
___ please respond in newsgroup, NOT by private email ___
=?Utf-8?B?WWFIb3puYQ==?= <YaHozna@.discussions.microsoft.com> wrote
on 11 feb 2007 in microsoft.public.sqlserver.server:
> Hi. Could anyone suggest why, whenever a third-party application
> that creates and uses its own SQL Server database, it creates
> the physical files in a location that is not the default? This
> doesn't seem to be an app-specific issue as different apps have
> done the same thing.
> As per the general advise data and log files on my system are
> held on separate volumes and when I create a new database myself
> the physical files are created in their default locations.
> However this is not the case with third-party apps. They seem to
> be creating the files in the same volume. How do I change this
> behavior. I had thought that the settings of the model database
> would determine where those files would go?
> YaHozna.|||> When CREATE DATABASE is used without options, the defaults are
> taken from the model database, but it is perfectly possible to
> override the defaults by using the NAME and FILENAME options with
> the CREATE DATABASE statement.
Although the model database is used as a template for new databases, the
default file locations are not determined by the model database. As Andrew
mentioned, default file locations can be specified separately via server
properties.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Vera Noest" <vera.noest@.remove-this.hem.utfors.se> wrote in message
news:Xns98D4A3986E7CDveranoesthemutforsse@.207.46.248.16...
> Many 3rd party applications do this, unfortunately.
> When CREATE DATABASE is used without options, the defaults are
> taken from the model database, but it is perfectly possible to
> override the defaults by using the NAME and FILENAME options with
> the CREATE DATABASE statement.
> You can change the location of the files after the installation.
> From http://sql.veranoest.net/sql_faq.htm
> Q. How can I move my database files to another disk in my SQL
> Server?
> A. An easy way to move user database files to a different location
> is by detaching, moving and attaching the user database.
> This can be done in SQL Server Management Studio so you don't have
> to type any code.
> Here are the steps:
> 1. Start SQL Server Management Studio
> 2. Expand the server instance, expand Databases
> 3. right-click the database you want to move, and choose
> "Properties"
> 4. In the Properties window, choose "Files" and write down the
> current file paths. Click "Cancel"
> 5. right-click the database again, and choose "Tasks - Detach..."
> 6. click "OK" in the next window
> 7. Use Windows Explorer to move the data and log files (.mdf and
> .ldf) to the new location
> 8. right-click Databases, and choose "Attach..."
> 9. In the "Attach databases" window, click "Add"
> 10.In the "Locate database files" window, browse to the new
> location and select the .mdf file. Click "OK"
> 11.In the details pane, verify that the new location is listed for
> both the .mdf and the .ldf file. Click "OK"
> 12.In SQL Server Management Studio, choose "View - Refresh" and
> verify that your database is listed again under Databases
> Alternatively you can backup the database and restore it,
> specifying a different location for the files on the options table
> or use the MOVE clause in the RESTORE command in Transact-SQL.
> Details are here:
> 221465 - INF: Using the WITH MOVE Option with the RESTORE Statement
> http://support.microsoft.com/?kbid=221465
> If you want to move the system databases, be sure to read these
> articles:
> Moving the SQL 2005 System Databases
> http://www.sqlservercentral.com/columnists/vIacoboni/2605.asp
> 224071 - How to move SQL Server databases to a new location by
> using Detach and Attach functions in SQL Server
> http://support.microsoft.com/?kbid=224071
> _________________________________________________________
> Vera Noest
> MCSE, CCEA, Microsoft MVP - Terminal Server
> SQL troubleshooting: http://sql.veranoest.net
> ___ please respond in newsgroup, NOT by private email ___
> =?Utf-8?B?WWFIb3puYQ==?= <YaHozna@.discussions.microsoft.com> wrote
> on 11 feb 2007 in microsoft.public.sqlserver.server:
>> Hi. Could anyone suggest why, whenever a third-party application
>> that creates and uses its own SQL Server database, it creates
>> the physical files in a location that is not the default? This
>> doesn't seem to be an app-specific issue as different apps have
>> done the same thing.
>> As per the general advise data and log files on my system are
>> held on separate volumes and when I create a new database myself
>> the physical files are created in their default locations.
>> However this is not the case with third-party apps. They seem to
>> be creating the files in the same volume. How do I change this
>> behavior. I had thought that the settings of the model database
>> would determine where those files would go?
>> YaHozna.|||Applications should never care where the database files are placed. That's a
DBA's job. Ideally, applications shouldn't be creating databases (I know they
do). They should use databases created for them. In cases they do create
databases in wrong locations, you should plan to move the files to the
correct locations.
But then I've seen apps that create databases on the fly as part of the
normal production process. Ouch!
Linchi
"YaHozna" wrote:
> Hi. Could anyone suggest why, whenever a third-party application that creates
> and uses its own SQL Server database, it creates the physical files in a
> location that is not the default? This doesn't seem to be an app-specific
> issue as different apps have done the same thing.
> As per the general advise data and log files on my system are held on
> separate volumes and when I create a new database myself the physical files
> are created in their default locations. However this is not the case with
> third-party apps. They seem to be creating the files in the same volume. How
> do I change this behavior. I had thought that the settings of the model
> database would determine where those files would go?
> YaHozna.|||Thanks Andrew and to the others who contributed. I did double-check the
Server settings and these are as they should be: data files are created on
volume E of a RAID array and Log files on volume D. Tempdb is also on volume
E and it was in that location - the folder in which the tempdb files exist -
that all files for new databases created by third-party apps seemed to be
being created for some reason.
No problem moving the files. Just wondered why this was happening.
Regards,
YaHozna
"Andrew J. Kelly" wrote:
> There is a server setting that determines the default location for the data
> and log files, not hte master db. Check the properties of the server in
> Enterprise Manager and you will find them.
> --
> Andrew J. Kelly SQL MVP
> "YaHozna" <YaHozna@.discussions.microsoft.com> wrote in message
> news:A74E91B5-7CDC-4143-ADFE-EF814499DE0B@.microsoft.com...
> > Hi. Could anyone suggest why, whenever a third-party application that
> > creates
> > and uses its own SQL Server database, it creates the physical files in a
> > location that is not the default? This doesn't seem to be an app-specific
> > issue as different apps have done the same thing.
> >
> > As per the general advise data and log files on my system are held on
> > separate volumes and when I create a new database myself the physical
> > files
> > are created in their default locations. However this is not the case with
> > third-party apps. They seem to be creating the files in the same volume.
> > How
> > do I change this behavior. I had thought that the settings of the model
> > database would determine where those files would go?
> >
> > YaHozna.
>
>

New database file locations

Hi. Could anyone suggest why, whenever a third-party application that creates
and uses its own SQL Server database, it creates the physical files in a
location that is not the default? This doesn't seem to be an app-specific
issue as different apps have done the same thing.
As per the general advise data and log files on my system are held on
separate volumes and when I create a new database myself the physical files
are created in their default locations. However this is not the case with
third-party apps. They seem to be creating the files in the same volume. How
do I change this behavior. I had thought that the settings of the model
database would determine where those files would go?
YaHozna.
Hello,
I feel that your third party application creates the database specifying the
path. In this case the database will be created based on the path specified
in CREATE DATABASE command. Incase if the path is not configurab,e in
application installlation, you could detach the database, copy the files
to required drive and folder and attach the database. See SP_DETACH_DB and
SP_ATTACH_DB in books online..
Thanks
Hari
"YaHozna" <YaHozna@.discussions.microsoft.com> wrote in message
news:A74E91B5-7CDC-4143-ADFE-EF814499DE0B@.microsoft.com...
> Hi. Could anyone suggest why, whenever a third-party application that
> creates
> and uses its own SQL Server database, it creates the physical files in a
> location that is not the default? This doesn't seem to be an app-specific
> issue as different apps have done the same thing.
> As per the general advise data and log files on my system are held on
> separate volumes and when I create a new database myself the physical
> files
> are created in their default locations. However this is not the case with
> third-party apps. They seem to be creating the files in the same volume.
> How
> do I change this behavior. I had thought that the settings of the model
> database would determine where those files would go?
> YaHozna.
|||There is a server setting that determines the default location for the data
and log files, not hte master db. Check the properties of the server in
Enterprise Manager and you will find them.
Andrew J. Kelly SQL MVP
"YaHozna" <YaHozna@.discussions.microsoft.com> wrote in message
news:A74E91B5-7CDC-4143-ADFE-EF814499DE0B@.microsoft.com...
> Hi. Could anyone suggest why, whenever a third-party application that
> creates
> and uses its own SQL Server database, it creates the physical files in a
> location that is not the default? This doesn't seem to be an app-specific
> issue as different apps have done the same thing.
> As per the general advise data and log files on my system are held on
> separate volumes and when I create a new database myself the physical
> files
> are created in their default locations. However this is not the case with
> third-party apps. They seem to be creating the files in the same volume.
> How
> do I change this behavior. I had thought that the settings of the model
> database would determine where those files would go?
> YaHozna.
|||Many 3rd party applications do this, unfortunately.
When CREATE DATABASE is used without options, the defaults are
taken from the model database, but it is perfectly possible to
override the defaults by using the NAME and FILENAME options with
the CREATE DATABASE statement.
You can change the location of the files after the installation.
From http://sql.veranoest.net/sql_faq.htm
Q. How can I move my database files to another disk in my SQL
Server?
A. An easy way to move user database files to a different location
is by detaching, moving and attaching the user database.
This can be done in SQL Server Management Studio so you don't have
to type any code.
Here are the steps:
1. Start SQL Server Management Studio
2. Expand the server instance, expand Databases
3. right-click the database you want to move, and choose
"Properties"
4. In the Properties window, choose "Files" and write down the
current file paths. Click "Cancel"
5. right-click the database again, and choose "Tasks - Detach..."
6. click "OK" in the next window
7. Use Windows Explorer to move the data and log files (.mdf and
.ldf) to the new location
8. right-click Databases, and choose "Attach..."
9. In the "Attach databases" window, click "Add"
10.In the "Locate database files" window, browse to the new
location and select the .mdf file. Click "OK"
11.In the details pane, verify that the new location is listed for
both the .mdf and the .ldf file. Click "OK"
12.In SQL Server Management Studio, choose "View - Refresh" and
verify that your database is listed again under Databases
Alternatively you can backup the database and restore it,
specifying a different location for the files on the options table
or use the MOVE clause in the RESTORE command in Transact-SQL.
Details are here:
221465 - INF: Using the WITH MOVE Option with the RESTORE Statement
http://support.microsoft.com/?kbid=221465
If you want to move the system databases, be sure to read these
articles:
Moving the SQL 2005 System Databases
http://www.sqlservercentral.com/columnists/vIacoboni/2605.asp
224071 - How to move SQL Server databases to a new location by
using Detach and Attach functions in SQL Server
http://support.microsoft.com/?kbid=224071
__________________________________________________ _______
Vera Noest
MCSE, CCEA, Microsoft MVP - Terminal Server
SQL troubleshooting: http://sql.veranoest.net
___ please respond in newsgroup, NOT by private email ___
=?Utf-8?B?WWFIb3puYQ==?= <YaHozna@.discussions.microsoft.com> wrote
on 11 feb 2007 in microsoft.public.sqlserver.server:

> Hi. Could anyone suggest why, whenever a third-party application
> that creates and uses its own SQL Server database, it creates
> the physical files in a location that is not the default? This
> doesn't seem to be an app-specific issue as different apps have
> done the same thing.
> As per the general advise data and log files on my system are
> held on separate volumes and when I create a new database myself
> the physical files are created in their default locations.
> However this is not the case with third-party apps. They seem to
> be creating the files in the same volume. How do I change this
> behavior. I had thought that the settings of the model database
> would determine where those files would go?
> YaHozna.
|||> When CREATE DATABASE is used without options, the defaults are
> taken from the model database, but it is perfectly possible to
> override the defaults by using the NAME and FILENAME options with
> the CREATE DATABASE statement.
Although the model database is used as a template for new databases, the
default file locations are not determined by the model database. As Andrew
mentioned, default file locations can be specified separately via server
properties.
Hope this helps.
Dan Guzman
SQL Server MVP
"Vera Noest" <vera.noest@.remove-this.hem.utfors.se> wrote in message
news:Xns98D4A3986E7CDveranoesthemutforsse@.207.46.2 48.16...[vbcol=seagreen]
> Many 3rd party applications do this, unfortunately.
> When CREATE DATABASE is used without options, the defaults are
> taken from the model database, but it is perfectly possible to
> override the defaults by using the NAME and FILENAME options with
> the CREATE DATABASE statement.
> You can change the location of the files after the installation.
> From http://sql.veranoest.net/sql_faq.htm
> Q. How can I move my database files to another disk in my SQL
> Server?
> A. An easy way to move user database files to a different location
> is by detaching, moving and attaching the user database.
> This can be done in SQL Server Management Studio so you don't have
> to type any code.
> Here are the steps:
> 1. Start SQL Server Management Studio
> 2. Expand the server instance, expand Databases
> 3. right-click the database you want to move, and choose
> "Properties"
> 4. In the Properties window, choose "Files" and write down the
> current file paths. Click "Cancel"
> 5. right-click the database again, and choose "Tasks - Detach..."
> 6. click "OK" in the next window
> 7. Use Windows Explorer to move the data and log files (.mdf and
> .ldf) to the new location
> 8. right-click Databases, and choose "Attach..."
> 9. In the "Attach databases" window, click "Add"
> 10.In the "Locate database files" window, browse to the new
> location and select the .mdf file. Click "OK"
> 11.In the details pane, verify that the new location is listed for
> both the .mdf and the .ldf file. Click "OK"
> 12.In SQL Server Management Studio, choose "View - Refresh" and
> verify that your database is listed again under Databases
> Alternatively you can backup the database and restore it,
> specifying a different location for the files on the options table
> or use the MOVE clause in the RESTORE command in Transact-SQL.
> Details are here:
> 221465 - INF: Using the WITH MOVE Option with the RESTORE Statement
> http://support.microsoft.com/?kbid=221465
> If you want to move the system databases, be sure to read these
> articles:
> Moving the SQL 2005 System Databases
> http://www.sqlservercentral.com/columnists/vIacoboni/2605.asp
> 224071 - How to move SQL Server databases to a new location by
> using Detach and Attach functions in SQL Server
> http://support.microsoft.com/?kbid=224071
> __________________________________________________ _______
> Vera Noest
> MCSE, CCEA, Microsoft MVP - Terminal Server
> SQL troubleshooting: http://sql.veranoest.net
> ___ please respond in newsgroup, NOT by private email ___
> =?Utf-8?B?WWFIb3puYQ==?= <YaHozna@.discussions.microsoft.com> wrote
> on 11 feb 2007 in microsoft.public.sqlserver.server:
|||Applications should never care where the database files are placed. That's a
DBA's job. Ideally, applications shouldn't be creating databases (I know they
do). They should use databases created for them. In cases they do create
databases in wrong locations, you should plan to move the files to the
correct locations.
But then I've seen apps that create databases on the fly as part of the
normal production process. Ouch!
Linchi
"YaHozna" wrote:

> Hi. Could anyone suggest why, whenever a third-party application that creates
> and uses its own SQL Server database, it creates the physical files in a
> location that is not the default? This doesn't seem to be an app-specific
> issue as different apps have done the same thing.
> As per the general advise data and log files on my system are held on
> separate volumes and when I create a new database myself the physical files
> are created in their default locations. However this is not the case with
> third-party apps. They seem to be creating the files in the same volume. How
> do I change this behavior. I had thought that the settings of the model
> database would determine where those files would go?
> YaHozna.
|||Thanks Andrew and to the others who contributed. I did double-check the
Server settings and these are as they should be: data files are created on
volume E of a RAID array and Log files on volume D. Tempdb is also on volume
E and it was in that location - the folder in which the tempdb files exist -
that all files for new databases created by third-party apps seemed to be
being created for some reason.
No problem moving the files. Just wondered why this was happening.
Regards,
YaHozna
"Andrew J. Kelly" wrote:

> There is a server setting that determines the default location for the data
> and log files, not hte master db. Check the properties of the server in
> Enterprise Manager and you will find them.
> --
> Andrew J. Kelly SQL MVP
> "YaHozna" <YaHozna@.discussions.microsoft.com> wrote in message
> news:A74E91B5-7CDC-4143-ADFE-EF814499DE0B@.microsoft.com...
>
>

New database file locations

Hi. Could anyone suggest why, whenever a third-party application that create
s
and uses its own SQL Server database, it creates the physical files in a
location that is not the default? This doesn't seem to be an app-specific
issue as different apps have done the same thing.
As per the general advise data and log files on my system are held on
separate volumes and when I create a new database myself the physical files
are created in their default locations. However this is not the case with
third-party apps. They seem to be creating the files in the same volume. How
do I change this behavior. I had thought that the settings of the model
database would determine where those files would go?
YaHozna.Hello,
I feel that your third party application creates the database specifying the
path. In this case the database will be created based on the path specified
in CREATE DATABASE command. Incase if the path is not configurab,e in
application installlation, you could detach the database, copy the files
to required drive and folder and attach the database. See SP_DETACH_DB and
SP_ATTACH_DB in books online..
Thanks
Hari
"YaHozna" <YaHozna@.discussions.microsoft.com> wrote in message
news:A74E91B5-7CDC-4143-ADFE-EF814499DE0B@.microsoft.com...
> Hi. Could anyone suggest why, whenever a third-party application that
> creates
> and uses its own SQL Server database, it creates the physical files in a
> location that is not the default? This doesn't seem to be an app-specific
> issue as different apps have done the same thing.
> As per the general advise data and log files on my system are held on
> separate volumes and when I create a new database myself the physical
> files
> are created in their default locations. However this is not the case with
> third-party apps. They seem to be creating the files in the same volume.
> How
> do I change this behavior. I had thought that the settings of the model
> database would determine where those files would go?
> YaHozna.|||There is a server setting that determines the default location for the data
and log files, not hte master db. Check the properties of the server in
Enterprise Manager and you will find them.
Andrew J. Kelly SQL MVP
"YaHozna" <YaHozna@.discussions.microsoft.com> wrote in message
news:A74E91B5-7CDC-4143-ADFE-EF814499DE0B@.microsoft.com...
> Hi. Could anyone suggest why, whenever a third-party application that
> creates
> and uses its own SQL Server database, it creates the physical files in a
> location that is not the default? This doesn't seem to be an app-specific
> issue as different apps have done the same thing.
> As per the general advise data and log files on my system are held on
> separate volumes and when I create a new database myself the physical
> files
> are created in their default locations. However this is not the case with
> third-party apps. They seem to be creating the files in the same volume.
> How
> do I change this behavior. I had thought that the settings of the model
> database would determine where those files would go?
> YaHozna.|||Many 3rd party applications do this, unfortunately.
When CREATE DATABASE is used without options, the defaults are
taken from the model database, but it is perfectly possible to
override the defaults by using the NAME and FILENAME options with
the CREATE DATABASE statement.
You can change the location of the files after the installation.
From http://sql.veranoest.net/sql_faq.htm
Q. How can I move my database files to another disk in my SQL
Server?
A. An easy way to move user database files to a different location
is by detaching, moving and attaching the user database.
This can be done in SQL Server Management Studio so you don't have
to type any code.
Here are the steps:
1. Start SQL Server Management Studio
2. Expand the server instance, expand Databases
3. right-click the database you want to move, and choose
"Properties"
4. In the Properties window, choose "Files" and write down the
current file paths. Click "Cancel"
5. right-click the database again, and choose "Tasks - Detach..."
6. click "OK" in the next window
7. Use Windows Explorer to move the data and log files (.mdf and
.ldf) to the new location
8. right-click Databases, and choose "Attach..."
9. In the "Attach databases" window, click "Add"
10.In the "Locate database files" window, browse to the new
location and select the .mdf file. Click "OK"
11.In the details pane, verify that the new location is listed for
both the .mdf and the .ldf file. Click "OK"
12.In SQL Server Management Studio, choose "View - Refresh" and
verify that your database is listed again under Databases
Alternatively you can backup the database and restore it,
specifying a different location for the files on the options table
or use the MOVE clause in the RESTORE command in Transact-SQL.
Details are here:
221465 - INF: Using the WITH MOVE Option with the RESTORE Statement
http://support.microsoft.com/?kbid=221465
If you want to move the system databases, be sure to read these
articles:
Moving the SQL 2005 System Databases
http://www.sqlservercentral.com/col...coboni/2605.asp
224071 - How to move SQL Server databases to a new location by
using Detach and Attach functions in SQL Server
http://support.microsoft.com/?kbid=224071
________________________________________
_________________
Vera Noest
MCSE, CCEA, Microsoft MVP - Terminal Server
SQL troubleshooting: http://sql.veranoest.net
___ please respond in newsgroup, NOT by private email ___
examnotes <YaHozna@.discussions.microsoft.com> wrote
on 11 feb 2007 in microsoft.public.sqlserver.server:

> Hi. Could anyone suggest why, whenever a third-party application
> that creates and uses its own SQL Server database, it creates
> the physical files in a location that is not the default? This
> doesn't seem to be an app-specific issue as different apps have
> done the same thing.
> As per the general advise data and log files on my system are
> held on separate volumes and when I create a new database myself
> the physical files are created in their default locations.
> However this is not the case with third-party apps. They seem to
> be creating the files in the same volume. How do I change this
> behavior. I had thought that the settings of the model database
> would determine where those files would go?
> YaHozna.|||> When CREATE DATABASE is used without options, the defaults are
> taken from the model database, but it is perfectly possible to
> override the defaults by using the NAME and FILENAME options with
> the CREATE DATABASE statement.
Although the model database is used as a template for new databases, the
default file locations are not determined by the model database. As Andrew
mentioned, default file locations can be specified separately via server
properties.
Hope this helps.
Dan Guzman
SQL Server MVP
"Vera Noest" <vera.noest@.remove-this.hem.utfors.se> wrote in message
news:Xns98D4A3986E7CDveranoesthemutforss
e@.207.46.248.16...[vbcol=seagreen]
> Many 3rd party applications do this, unfortunately.
> When CREATE DATABASE is used without options, the defaults are
> taken from the model database, but it is perfectly possible to
> override the defaults by using the NAME and FILENAME options with
> the CREATE DATABASE statement.
> You can change the location of the files after the installation.
> From http://sql.veranoest.net/sql_faq.htm
> Q. How can I move my database files to another disk in my SQL
> Server?
> A. An easy way to move user database files to a different location
> is by detaching, moving and attaching the user database.
> This can be done in SQL Server Management Studio so you don't have
> to type any code.
> Here are the steps:
> 1. Start SQL Server Management Studio
> 2. Expand the server instance, expand Databases
> 3. right-click the database you want to move, and choose
> "Properties"
> 4. In the Properties window, choose "Files" and write down the
> current file paths. Click "Cancel"
> 5. right-click the database again, and choose "Tasks - Detach..."
> 6. click "OK" in the next window
> 7. Use Windows Explorer to move the data and log files (.mdf and
> .ldf) to the new location
> 8. right-click Databases, and choose "Attach..."
> 9. In the "Attach databases" window, click "Add"
> 10.In the "Locate database files" window, browse to the new
> location and select the .mdf file. Click "OK"
> 11.In the details pane, verify that the new location is listed for
> both the .mdf and the .ldf file. Click "OK"
> 12.In SQL Server Management Studio, choose "View - Refresh" and
> verify that your database is listed again under Databases
> Alternatively you can backup the database and restore it,
> specifying a different location for the files on the options table
> or use the MOVE clause in the RESTORE command in Transact-SQL.
> Details are here:
> 221465 - INF: Using the WITH MOVE Option with the RESTORE Statement
> http://support.microsoft.com/?kbid=221465
> If you want to move the system databases, be sure to read these
> articles:
> Moving the SQL 2005 System Databases
> http://www.sqlservercentral.com/col...coboni/2605.asp
> 224071 - How to move SQL Server databases to a new location by
> using Detach and Attach functions in SQL Server
> http://support.microsoft.com/?kbid=224071
> ________________________________________
_________________
> Vera Noest
> MCSE, CCEA, Microsoft MVP - Terminal Server
> SQL troubleshooting: http://sql.veranoest.net
> ___ please respond in newsgroup, NOT by private email ___
> examnotes <YaHozna@.discussions.microsoft.com> wrote
> on 11 feb 2007 in microsoft.public.sqlserver.server:
>|||Applications should never care where the database files are placed. That's a
DBA's job. Ideally, applications shouldn't be creating databases (I know the
y
do). They should use databases created for them. In cases they do create
databases in wrong locations, you should plan to move the files to the
correct locations.
But then I've seen apps that create databases on the fly as part of the
normal production process. Ouch!
Linchi
"YaHozna" wrote:

> Hi. Could anyone suggest why, whenever a third-party application that crea
tes
> and uses its own SQL Server database, it creates the physical files in a
> location that is not the default? This doesn't seem to be an app-specific
> issue as different apps have done the same thing.
> As per the general advise data and log files on my system are held on
> separate volumes and when I create a new database myself the physical file
s
> are created in their default locations. However this is not the case with
> third-party apps. They seem to be creating the files in the same volume. H
ow
> do I change this behavior. I had thought that the settings of the model
> database would determine where those files would go?
> YaHozna.|||Thanks Andrew and to the others who contributed. I did double-check the
Server settings and these are as they should be: data files are created on
volume E of a RAID array and Log files on volume D. Tempdb is also on volume
E and it was in that location - the folder in which the tempdb files exist -
that all files for new databases created by third-party apps seemed to be
being created for some reason.
No problem moving the files. Just wondered why this was happening.
Regards,
YaHozna
"Andrew J. Kelly" wrote:

> There is a server setting that determines the default location for the dat
a
> and log files, not hte master db. Check the properties of the server in
> Enterprise Manager and you will find them.
> --
> Andrew J. Kelly SQL MVP
> "YaHozna" <YaHozna@.discussions.microsoft.com> wrote in message
> news:A74E91B5-7CDC-4143-ADFE-EF814499DE0B@.microsoft.com...
>
>

new custom flat file connection manager component

The standard flat file connection component does not handle flat files with different column counts on different rows. Since that's the type of file I have to read, I like to create a modified version of the flat file connection manager that can do this. I have found some info in how to create a connection manager. But I can't find anything that tels me how to build one that would be recognized by the flat file source dataflow component.

So how do you build an connection manager that can used by the standard flat file source component? Anyone ever did this or knows were to get the docs?

I know my problem is also solvable by reading the row into a single column and then using a script component to split them but that is not the solution I want.

The new connection manager is not going to solve this problem. The parsing logic is not part of the connection manager, it is part of the Flat File source adapter. You would need to build a new source, not connection manager.

Thanks,

Bob