Showing posts with label mdf. Show all posts
Showing posts with label mdf. Show all posts

Sunday, March 25, 2012

Bind 2 tables from different database file.

Hi!

I have 2 databases. One is ASPNETDB.MDF and another is PPQ_Data.MDF
ASPNETDB.MDF is generated by ASP.net (VWD 2005) when I use Login control.
PPQ_Data.MDF is created by me. It contains menu and order information of my website.

I would like to connect this 2 databases together so that I can createa GridView table that binds 2 tables, one from ASPNETDB.MDF and anothertable from PPQ_Data.MDF. So, it is kind of displaying nested data.

Is there anybody out there that know how to connect 2 databases together?

Again, my purpose of connecting 2 databases together is to pull out a table from each database and bind the 2 tables together.

thanks in advanced for any advice or articles submitted.

You can use qualified database object name to refer to tables in different databases, and even from different servers (you have to make sure the app can connect to all referenced databse resources). Forexample (I suppose you database name to be c:\ASPNETDB.MDF and c:\PPQ_Data.MDF):

select * from [c:\ASPNETDB.MDF]..table1 , [c:\PPQ_Data.MDF]..table2

For more information, please see this article:

http://msdn.microsoft.com/library/en-us/tsqlref/ts_fa-fz_4ox9.asp?frame=true

|||Ohhw, yeah, thanks for the reply. I almost forget about SQL server online book. thanks!

Thursday, March 22, 2012

bigpubs2000

I heard about bigpubs2000.mdf but i can't found it in google. Maybe someone
have it. or have a good link to download this db.genuine wrote:
> I heard about bigpubs2000.mdf but i can't found it in google. Maybe someone
> have it. or have a good link to download this db.

I haven't downloaded or used this but I can find:
http://www.google.com/search?q=bigpubs2000

If you are looking for samples Microsoft publishes a 50MB database for
2000 called AdventureWorks:
http://www.microsoft.com/downloads/...a8-2bfb66f0abdc

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/...US,SQL.90).aspx
--|||i found that on
http://safariexamples.informit.com/...le%20Databases/
:)

Uzytkownik "David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> napisal w
wiadomosci news:1142675514.907948.325880@.u72g2000cwu.googlegr oups.com...
> genuine wrote:
>> I heard about bigpubs2000.mdf but i can't found it in google. Maybe
>> someone
>> have it. or have a good link to download this db.
> I haven't downloaded or used this but I can find:
> http://www.google.com/search?q=bigpubs2000
> If you are looking for samples Microsoft publishes a 50MB database for
> 2000 called AdventureWorks:
> http://www.microsoft.com/downloads/...a8-2bfb66f0abdc
> --
> David Portas, SQL Server MVP
> Whenever possible please post enough code to reproduce your problem.
> Including CREATE TABLE and INSERT statements usually helps.
> State what version of SQL Server you are using and specify the content
> of any error messages.
> SQL Server Books Online:
> http://msdn2.microsoft.com/library/...US,SQL.90).aspx
> --sql

Monday, March 19, 2012

BIG LDF file size

How to check for LDF file size I.e. my database ldf size is 10 times the
size of mdf. is it ok. For having smaller ldf do i need to check for some sp
or tune sps and other DTS packages.
I am using JOB which execute 10 DTS once daily...ldf file growing many times bigger than mdf is fine...
But if you want to limit the ldf's from growing beyond, you need to
take regular transaction log backups.
If you want to shrink ldf file and release the space back to OS, then
you can even do SHRINKFILE|||Vikram wrote:
> How to check for LDF file size I.e. my database ldf size is 10 times the
> size of mdf. is it ok. For having smaller ldf do i need to check for some
sp
> or tune sps and other DTS packages.
> I am using JOB which execute 10 DTS once daily...
>
It's not very likely that your logfile needs to be 10 times your
datafile, so you might have to backup your logfile.
If your database are in FULL recovery mode, you should make sure that
you run logfile backups regularly so the logfile get truncated and you
can reuse the space in the file.
If your database are in Simple recovery mode, you can't backup the log
and it will be truncated automatically, but then it might be that you
simply need such a big logfile.
Executing 10 DTS jobs daily doesn't tell a lot since you don't tell what
they actually do.
If you find that you have a lot of unused space in your logfile (e.g. if
you've never ran a logfile backup and then starts to do it) you can
shrink the file to a more appropriate size by running DBCC SHRINKFILE.
You can check how much space is used in the logfile by running DBCC
SQLPERF ( LOGSPACE ) or by using Enterprise Manager.
Regards
Steen

BIG LDF file size

How to check for LDF file size I.e. my database ldf size is 10 times the
size of mdf. is it ok. For having smaller ldf do i need to check for some sp
or tune sps and other DTS packages.
I am using JOB which execute 10 DTS once daily...
ldf file growing many times bigger than mdf is fine...
But if you want to limit the ldf's from growing beyond, you need to
take regular transaction log backups.
If you want to shrink ldf file and release the space back to OS, then
you can even do SHRINKFILE
|||Vikram wrote:
> How to check for LDF file size I.e. my database ldf size is 10 times the
> size of mdf. is it ok. For having smaller ldf do i need to check for some sp
> or tune sps and other DTS packages.
> I am using JOB which execute 10 DTS once daily...
>
It's not very likely that your logfile needs to be 10 times your
datafile, so you might have to backup your logfile.
If your database are in FULL recovery mode, you should make sure that
you run logfile backups regularly so the logfile get truncated and you
can reuse the space in the file.
If your database are in Simple recovery mode, you can't backup the log
and it will be truncated automatically, but then it might be that you
simply need such a big logfile.
Executing 10 DTS jobs daily doesn't tell a lot since you don't tell what
they actually do.
If you find that you have a lot of unused space in your logfile (e.g. if
you've never ran a logfile backup and then starts to do it) you can
shrink the file to a more appropriate size by running DBCC SHRINKFILE.
You can check how much space is used in the logfile by running DBCC
SQLPERF ( LOGSPACE ) or by using Enterprise Manager.

Regards
Steen

BIG LDF file size

How to check for LDF file size I.e. my database ldf size is 10 times the
size of mdf. is it ok. For having smaller ldf do i need to check for some sp
or tune sps and other DTS packages.
I am using JOB which execute 10 DTS once daily...ldf file growing many times bigger than mdf is fine...
But if you want to limit the ldf's from growing beyond, you need to
take regular transaction log backups.
If you want to shrink ldf file and release the space back to OS, then
you can even do SHRINKFILE|||Vikram wrote:
> How to check for LDF file size I.e. my database ldf size is 10 times the
> size of mdf. is it ok. For having smaller ldf do i need to check for some sp
> or tune sps and other DTS packages.
> I am using JOB which execute 10 DTS once daily...
>
It's not very likely that your logfile needs to be 10 times your
datafile, so you might have to backup your logfile.
If your database are in FULL recovery mode, you should make sure that
you run logfile backups regularly so the logfile get truncated and you
can reuse the space in the file.
If your database are in Simple recovery mode, you can't backup the log
and it will be truncated automatically, but then it might be that you
simply need such a big logfile.
Executing 10 DTS jobs daily doesn't tell a lot since you don't tell what
they actually do.
If you find that you have a lot of unused space in your logfile (e.g. if
you've never ran a logfile backup and then starts to do it) you can
shrink the file to a more appropriate size by running DBCC SHRINKFILE.
You can check how much space is used in the logfile by running DBCC
SQLPERF ( LOGSPACE ) or by using Enterprise Manager.
Regards
Steen