Showing posts with label real. Show all posts
Showing posts with label real. Show all posts

Thursday, March 22, 2012

Build a Connection String Programmatically

I'm getting really frustrated with using the web.config to store all database information. It seems like you really don't have any real flexibilty when moving an application from server to server (between dev, test and prod). Seems like you have to create separate config files when you move it every time. Seems like you always run into a risk of over writing one of them if you are not careful.

Is there a good way to design the connection object to be able to tell which server it is on and determine if it's a test, dev or prod type of connection. I have used a basic three connection strings that it will compare the computer name with the key. But again, the connection string is hard coded in the web config. At least this way I am able to move all code together without the worry of overwritting the config file. I just have to beleive there is a better way to build something like this. I've heard of setting up enviroment variables on the server, but not sure how safe that is.

I'm looking everywhere on the web, but get really lame examples. If anyone knows a good method or a sample I can check out, that would be great.

Thanks!

Im not sure about building a connectionstring dynamically, but the generally accepted way to solve this is with a User.config file for you and the host. You keep all the normal crap in the webconfig, and then your connection string and any other variables in the userconfig. Here is a good example.

http://blogs.msdn.com/rprabhu/articles/433979.aspx

BugS QL Server 2005 Beta 2

Dear Newsgroup Members !
I think, and that's my real thinking, i never saw a SQL-Server where has so
many Bugs inside.
Ok, it's a Beta, but that's no OK.
After 3 Days work and 4 Installations the SQL-Server run exactly. OK, that's
live.
But the great BUG after a lot other befor, is the BUG where you can delete
some Databases in the SQL Server Managment Studio with 1 Action and without
any Delete-Question. The Databases are in Nirwana.
I get my Version up and wish you a good time.
Thanks
GeraldGerald (Gerald@.discussions.microsoft.com) writes:
> I think, and that's my real thinking, i never saw a SQL-Server where
> has so many Bugs inside.
> Ok, it's a Beta, but that's no OK.
> After 3 Days work and 4 Installations the SQL-Server run exactly. OK,
> that's live. But the great BUG after a lot other befor, is the BUG where
> you can delete some Databases in the SQL Server Managment Studio with 1
> Action and without any Delete-Question. The Databases are in Nirwana.
> I get my Version up and wish you a good time.
Beware that beta 2 is over a year old now. You find the most recent drop
here: http://www.microsoft.com/sql/2005/productinfo/ctp.mspx.
As for deleting database, I tried this and I got a dialog about
dropping an object. If you just pressed Delete by mistake, you should
react.
Also, please use the SQL 2005 newsgroups for SQL 2005, as these groups
are monitored by the SQL Server Devs. Access information here:
http://go.microsoft.com/fwlink/?linkid=31765
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

Thursday, March 8, 2012

Bug in DBCC SHRINKDATABASE ?

Hi,
My real DB size is 5 MB and transaction log 30 MB. But transaction log
allocated 900 MB. And if I run
DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
it does not shrink me transaction log neither a bit. Why ????
I do not want to have so big transaction log.
BJ
Run DBCC SHRINKFILE instead
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> Hi,
> My real DB size is 5 MB and transaction log 30 MB. But transaction log
> allocated 900 MB. And if I run
> DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> it does not shrink me transaction log neither a bit. Why
????
> I do not want to have so big transaction log.
|||I tried
DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
and nothing happened.
"Uri Dimant" wrote:

> BJ
> Run DBCC SHRINKFILE instead
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> ????
>
>
|||B.J
What are you really trying to do?
You have emptied the file, have you tried to remove it by using EM?
Are you trying to reduce the size of the log file?
Are you trying to delete/remove the log file?
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...[vbcol=seagreen]
> I tried
> DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
> and nothing happened.
> "Uri Dimant" wrote:
|||I want to reduce transaction log size.
when I right click my database and point to all task / shrink database / files
then I have :
Data
current size : 5 MB
Space used : 4 MB
Log
current size : 900,62 MB
Space used : 33,4 MB
And this does not like me. I have allocated to much size. I want to truncate
log to 35 MB. I did all combination of options in all task / shrink database
and no result and also I have not set minimal transaction log so I do not
know wehre is problem.
Hope I said you what you want.
"Uri Dimant" wrote:

> B.J
> What are you really trying to do?
> You have emptied the file, have you tried to remove it by using EM?
> Are you trying to reduce the size of the log file?
> Are you trying to delete/remove the log file?
>
>
>
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...
>
>
|||BJ
1) Backup Log file (to truncate a commited transaction (inactive portion)
2) Run DBCC SHRINKFILE
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:4E607247-C485-468F-B5E7-7EAFAA1C03D9@.microsoft.com...
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink database /
files
> then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to
truncate
> log to 35 MB. I did all combination of options in all task / shrink
database[vbcol=seagreen]
> and no result and also I have not set minimal transaction log so I do not
> know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
log[vbcol=seagreen]
|||Hi B.J.
Try to look up BACKUP LOG and DBCC SHRINKFILE in BOL and make sure that you
do the right things. It could be that you haven't truncated the logfile
correctly and/or haven't shrinked the logfile but the database.
Regards
Steen
B.J. wrote:[vbcol=seagreen]
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink
> database / files then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to
> truncate log to 35 MB. I did all combination of options in all task /
> shrink database and no result and also I have not set minimal
> transaction log so I do not know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
|||B J
Have a look at these articles on shrinking the Transaction log.
INF: How to Shrink the SQL Server 7.0 Transaction Log
http://support.microsoft.com/default...b;en-us;256650
INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC SHRINKFILE
http://support.microsoft.com/default...b;en-us;272318
http://www.mssqlserver.com/faq/logs-shrinklog.asp
Usually a transaction log only needs to be around 10 - 20% of the size of
the database. I assume you have a database in Full recovery mode and you do
not perform transaction log backups. Either set your database to simple
recovery mode or start taking regular transaction log backups.
Hope this helps
John
"B.J." wrote:
[vbcol=seagreen]
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink database / files
> then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to truncate
> log to 35 MB. I did all combination of options in all task / shrink database
> and no result and also I have not set minimal transaction log so I do not
> know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
|||I did it and nothing. Read all about how to truncate log from help which is
installed to SQL Server 2000 but it does not work.
"Uri Dimant" wrote:

> BJ
> 1) Backup Log file (to truncate a commited transaction (inactive portion)
> 2) Run DBCC SHRINKFILE
>
>
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:4E607247-C485-468F-B5E7-7EAFAA1C03D9@.microsoft.com...
> files
> truncate
> database
> log
>
>

Bug in DBCC SHRINKDATABASE ?

Hi,
My real DB size is 5 MB and transaction log 30 MB. But transaction log
allocated 900 MB. And if I run
DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
it does not shrink me transaction log neither a bit. Why '''?
I do not want to have so big transaction log.BJ
Run DBCC SHRINKFILE instead
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> Hi,
> My real DB size is 5 MB and transaction log 30 MB. But transaction log
> allocated 900 MB. And if I run
> DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> it does not shrink me transaction log neither a bit. Why
'''?
> I do not want to have so big transaction log.|||I tried
DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
and nothing happened.
"Uri Dimant" wrote:

> BJ
> Run DBCC SHRINKFILE instead
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> '''?
>
>|||B.J
What are you really trying to do?
You have emptied the file, have you tried to remove it by using EM?
Are you trying to reduce the size of the log file?
Are you trying to delete/remove the log file?
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...[vbcol=seagreen]
> I tried
> DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
> and nothing happened.
> "Uri Dimant" wrote:
>|||I want to reduce transaction log size.
when I right click my database and point to all task / shrink database / fil
es
then I have :
Data
current size : 5 MB
Space used : 4 MB
Log
current size : 900,62 MB
Space used : 33,4 MB
And this does not like me. I have allocated to much size. I want to truncate
log to 35 MB. I did all combination of options in all task / shrink database
and no result and also I have not set minimal transaction log so I do not
know wehre is problem.
Hope I said you what you want.
"Uri Dimant" wrote:

> B.J
> What are you really trying to do?
> You have emptied the file, have you tried to remove it by using EM?
> Are you trying to reduce the size of the log file?
> Are you trying to delete/remove the log file?
>
>
>
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...
>
>|||BJ
1) Backup Log file (to truncate a commited transaction (inactive portion)
2) Run DBCC SHRINKFILE
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:4E607247-C485-468F-B5E7-7EAFAA1C03D9@.microsoft.com...
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink database /
files
> then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to
truncate
> log to 35 MB. I did all combination of options in all task / shrink
database[vbcol=seagreen]
> and no result and also I have not set minimal transaction log so I do not
> know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
>
log[vbcol=seagreen]|||Hi B.J.
Try to look up BACKUP LOG and DBCC SHRINKFILE in BOL and make sure that you
do the right things. It could be that you haven't truncated the logfile
correctly and/or haven't shrinked the logfile but the database.
Regards
Steen
B.J. wrote:[vbcol=seagreen]
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink
> database / files then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to
> truncate log to 35 MB. I did all combination of options in all task /
> shrink database and no result and also I have not set minimal
> transaction log so I do not know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
>|||B J
Have a look at these articles on shrinking the Transaction log.
INF: How to Shrink the SQL Server 7.0 Transaction Log
http://support.microsoft.com/defaul...kb;en-us;256650
INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC SHRINKFILE
http://support.microsoft.com/defaul...kb;en-us;272318
http://www.mssqlserver.com/faq/logs-shrinklog.asp
Usually a transaction log only needs to be around 10 - 20% of the size of
the database. I assume you have a database in Full recovery mode and you do
not perform transaction log backups. Either set your database to simple
recovery mode or start taking regular transaction log backups.
Hope this helps
John
"B.J." wrote:
[vbcol=seagreen]
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink database / f
iles
> then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to trunca
te
> log to 35 MB. I did all combination of options in all task / shrink databa
se
> and no result and also I have not set minimal transaction log so I do not
> know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
>|||I did it and nothing. Read all about how to truncate log from help which is
installed to SQL Server 2000 but it does not work.
"Uri Dimant" wrote:

> BJ
> 1) Backup Log file (to truncate a commited transaction (inactive portion)
> 2) Run DBCC SHRINKFILE
>
>
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:4E607247-C485-468F-B5E7-7EAFAA1C03D9@.microsoft.com...
> files
> truncate
> database
> log
>
>

Bug in DBCC SHRINKDATABASE ?

Hi,
My real DB size is 5 MB and transaction log 30 MB. But transaction log
allocated 900 MB. And if I run
DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
it does not shrink me transaction log neither a bit. Why '''?
I do not want to have so big transaction log.BJ
Run DBCC SHRINKFILE instead
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> Hi,
> My real DB size is 5 MB and transaction log 30 MB. But transaction log
> allocated 900 MB. And if I run
> DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> it does not shrink me transaction log neither a bit. Why
'''?
> I do not want to have so big transaction log.|||I tried
DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
and nothing happened.
"Uri Dimant" wrote:
> BJ
> Run DBCC SHRINKFILE instead
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> > Hi,
> >
> > My real DB size is 5 MB and transaction log 30 MB. But transaction log
> > allocated 900 MB. And if I run
> >
> > DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> >
> > it does not shrink me transaction log neither a bit. Why
> '''?
> > I do not want to have so big transaction log.
>
>|||B.J
What are you really trying to do?
You have emptied the file, have you tried to remove it by using EM?
Are you trying to reduce the size of the log file?
Are you trying to delete/remove the log file?
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...
> I tried
> DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
> and nothing happened.
> "Uri Dimant" wrote:
> > BJ
> > Run DBCC SHRINKFILE instead
> >
> > "B.J." <BJ@.discussions.microsoft.com> wrote in message
> > news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> > > Hi,
> > >
> > > My real DB size is 5 MB and transaction log 30 MB. But transaction log
> > > allocated 900 MB. And if I run
> > >
> > > DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> > >
> > > it does not shrink me transaction log neither a bit. Why
> > '''?
> > > I do not want to have so big transaction log.
> >
> >
> >|||I want to reduce transaction log size.
when I right click my database and point to all task / shrink database / files
then I have :
Data
current size : 5 MB
Space used : 4 MB
Log
current size : 900,62 MB
Space used : 33,4 MB
And this does not like me. I have allocated to much size. I want to truncate
log to 35 MB. I did all combination of options in all task / shrink database
and no result and also I have not set minimal transaction log so I do not
know wehre is problem.
Hope I said you what you want.
"Uri Dimant" wrote:
> B.J
> What are you really trying to do?
> You have emptied the file, have you tried to remove it by using EM?
> Are you trying to reduce the size of the log file?
> Are you trying to delete/remove the log file?
>
>
>
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...
> > I tried
> >
> > DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
> >
> > and nothing happened.
> >
> > "Uri Dimant" wrote:
> >
> > > BJ
> > > Run DBCC SHRINKFILE instead
> > >
> > > "B.J." <BJ@.discussions.microsoft.com> wrote in message
> > > news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> > > > Hi,
> > > >
> > > > My real DB size is 5 MB and transaction log 30 MB. But transaction log
> > > > allocated 900 MB. And if I run
> > > >
> > > > DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> > > >
> > > > it does not shrink me transaction log neither a bit. Why
> > > '''?
> > > > I do not want to have so big transaction log.
> > >
> > >
> > >
>
>|||BJ
1) Backup Log file (to truncate a commited transaction (inactive portion)
2) Run DBCC SHRINKFILE
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:4E607247-C485-468F-B5E7-7EAFAA1C03D9@.microsoft.com...
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink database /
files
> then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to
truncate
> log to 35 MB. I did all combination of options in all task / shrink
database
> and no result and also I have not set minimal transaction log so I do not
> know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
> > B.J
> > What are you really trying to do?
> > You have emptied the file, have you tried to remove it by using EM?
> >
> > Are you trying to reduce the size of the log file?
> >
> > Are you trying to delete/remove the log file?
> >
> >
> >
> >
> >
> >
> > "B.J." <BJ@.discussions.microsoft.com> wrote in message
> > news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...
> > > I tried
> > >
> > > DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
> > >
> > > and nothing happened.
> > >
> > > "Uri Dimant" wrote:
> > >
> > > > BJ
> > > > Run DBCC SHRINKFILE instead
> > > >
> > > > "B.J." <BJ@.discussions.microsoft.com> wrote in message
> > > > news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> > > > > Hi,
> > > > >
> > > > > My real DB size is 5 MB and transaction log 30 MB. But transaction
log
> > > > > allocated 900 MB. And if I run
> > > > >
> > > > > DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> > > > >
> > > > > it does not shrink me transaction log neither a bit. Why
> > > > '''?
> > > > > I do not want to have so big transaction log.
> > > >
> > > >
> > > >
> >
> >
> >|||Hi B.J.
Try to look up BACKUP LOG and DBCC SHRINKFILE in BOL and make sure that you
do the right things. It could be that you haven't truncated the logfile
correctly and/or haven't shrinked the logfile but the database.
Regards
Steen
B.J. wrote:
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink
> database / files then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to
> truncate log to 35 MB. I did all combination of options in all task /
> shrink database and no result and also I have not set minimal
> transaction log so I do not know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
>> B.J
>> What are you really trying to do?
>> You have emptied the file, have you tried to remove it by using EM?
>> Are you trying to reduce the size of the log file?
>> Are you trying to delete/remove the log file?
>>
>>
>>
>> "B.J." <BJ@.discussions.microsoft.com> wrote in message
>> news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...
>> I tried
>> DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
>> and nothing happened.
>> "Uri Dimant" wrote:
>> BJ
>> Run DBCC SHRINKFILE instead
>> "B.J." <BJ@.discussions.microsoft.com> wrote in message
>> news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
>> Hi,
>> My real DB size is 5 MB and transaction log 30 MB. But
>> transaction log allocated 900 MB. And if I run
>> DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
>> it does not shrink me transaction log neither a bit. Why
>> '''? I do not want to have so big transaction log.|||B J
Have a look at these articles on shrinking the Transaction log.
INF: How to Shrink the SQL Server 7.0 Transaction Log
http://support.microsoft.com/default.aspx?scid=kb;en-us;256650
INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC SHRINKFILE
http://support.microsoft.com/default.aspx?scid=kb;en-us;272318
http://www.mssqlserver.com/faq/logs-shrinklog.asp
Usually a transaction log only needs to be around 10 - 20% of the size of
the database. I assume you have a database in Full recovery mode and you do
not perform transaction log backups. Either set your database to simple
recovery mode or start taking regular transaction log backups.
Hope this helps
John
"B.J." wrote:
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink database / files
> then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to truncate
> log to 35 MB. I did all combination of options in all task / shrink database
> and no result and also I have not set minimal transaction log so I do not
> know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
> > B.J
> > What are you really trying to do?
> > You have emptied the file, have you tried to remove it by using EM?
> >
> > Are you trying to reduce the size of the log file?
> >
> > Are you trying to delete/remove the log file?
> >
> >
> >
> >
> >
> >
> > "B.J." <BJ@.discussions.microsoft.com> wrote in message
> > news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...
> > > I tried
> > >
> > > DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
> > >
> > > and nothing happened.
> > >
> > > "Uri Dimant" wrote:
> > >
> > > > BJ
> > > > Run DBCC SHRINKFILE instead
> > > >
> > > > "B.J." <BJ@.discussions.microsoft.com> wrote in message
> > > > news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> > > > > Hi,
> > > > >
> > > > > My real DB size is 5 MB and transaction log 30 MB. But transaction log
> > > > > allocated 900 MB. And if I run
> > > > >
> > > > > DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> > > > >
> > > > > it does not shrink me transaction log neither a bit. Why
> > > > '''?
> > > > > I do not want to have so big transaction log.
> > > >
> > > >
> > > >
> >
> >
> >|||I did it and nothing. Read all about how to truncate log from help which is
installed to SQL Server 2000 but it does not work.
"Uri Dimant" wrote:
> BJ
> 1) Backup Log file (to truncate a commited transaction (inactive portion)
> 2) Run DBCC SHRINKFILE
>
>
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:4E607247-C485-468F-B5E7-7EAFAA1C03D9@.microsoft.com...
> > I want to reduce transaction log size.
> >
> > when I right click my database and point to all task / shrink database /
> files
> > then I have :
> > Data
> > current size : 5 MB
> > Space used : 4 MB
> >
> > Log
> > current size : 900,62 MB
> > Space used : 33,4 MB
> >
> >
> > And this does not like me. I have allocated to much size. I want to
> truncate
> > log to 35 MB. I did all combination of options in all task / shrink
> database
> > and no result and also I have not set minimal transaction log so I do not
> > know wehre is problem.
> > Hope I said you what you want.
> >
> > "Uri Dimant" wrote:
> >
> > > B.J
> > > What are you really trying to do?
> > > You have emptied the file, have you tried to remove it by using EM?
> > >
> > > Are you trying to reduce the size of the log file?
> > >
> > > Are you trying to delete/remove the log file?
> > >
> > >
> > >
> > >
> > >
> > >
> > > "B.J." <BJ@.discussions.microsoft.com> wrote in message
> > > news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...
> > > > I tried
> > > >
> > > > DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
> > > >
> > > > and nothing happened.
> > > >
> > > > "Uri Dimant" wrote:
> > > >
> > > > > BJ
> > > > > Run DBCC SHRINKFILE instead
> > > > >
> > > > > "B.J." <BJ@.discussions.microsoft.com> wrote in message
> > > > > news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> > > > > > Hi,
> > > > > >
> > > > > > My real DB size is 5 MB and transaction log 30 MB. But transaction
> log
> > > > > > allocated 900 MB. And if I run
> > > > > >
> > > > > > DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> > > > > >
> > > > > > it does not shrink me transaction log neither a bit. Why
> > > > > '''?
> > > > > > I do not want to have so big transaction log.
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>|||Thank you,
KB help me, exactly
DBCC SHRINKFILE('N_Log', 0);
BACKUP LOG N WITH TRUNCATE_ONLY
DBCC SHRINKFILE('N', 0);
Have a nice day :)
"John Bandettini" wrote:
> B J
> Have a look at these articles on shrinking the Transaction log.
> INF: How to Shrink the SQL Server 7.0 Transaction Log
> http://support.microsoft.com/default.aspx?scid=kb;en-us;256650
> INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC SHRINKFILE
> http://support.microsoft.com/default.aspx?scid=kb;en-us;272318
> http://www.mssqlserver.com/faq/logs-shrinklog.asp
> Usually a transaction log only needs to be around 10 - 20% of the size of
> the database. I assume you have a database in Full recovery mode and you do
> not perform transaction log backups. Either set your database to simple
> recovery mode or start taking regular transaction log backups.
> Hope this helps
> John
> "B.J." wrote:
> > I want to reduce transaction log size.
> >
> > when I right click my database and point to all task / shrink database / files
> > then I have :
> > Data
> > current size : 5 MB
> > Space used : 4 MB
> >
> > Log
> > current size : 900,62 MB
> > Space used : 33,4 MB
> >
> >
> > And this does not like me. I have allocated to much size. I want to truncate
> > log to 35 MB. I did all combination of options in all task / shrink database
> > and no result and also I have not set minimal transaction log so I do not
> > know wehre is problem.
> > Hope I said you what you want.
> >
> > "Uri Dimant" wrote:
> >
> > > B.J
> > > What are you really trying to do?
> > > You have emptied the file, have you tried to remove it by using EM?
> > >
> > > Are you trying to reduce the size of the log file?
> > >
> > > Are you trying to delete/remove the log file?
> > >
> > >
> > >
> > >
> > >
> > >
> > > "B.J." <BJ@.discussions.microsoft.com> wrote in message
> > > news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...
> > > > I tried
> > > >
> > > > DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
> > > >
> > > > and nothing happened.
> > > >
> > > > "Uri Dimant" wrote:
> > > >
> > > > > BJ
> > > > > Run DBCC SHRINKFILE instead
> > > > >
> > > > > "B.J." <BJ@.discussions.microsoft.com> wrote in message
> > > > > news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> > > > > > Hi,
> > > > > >
> > > > > > My real DB size is 5 MB and transaction log 30 MB. But transaction log
> > > > > > allocated 900 MB. And if I run
> > > > > >
> > > > > > DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> > > > > >
> > > > > > it does not shrink me transaction log neither a bit. Why
> > > > > '''?
> > > > > > I do not want to have so big transaction log.
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >