Showing posts with label according. Show all posts
Showing posts with label according. Show all posts

Friday, February 24, 2012

Cannot shrink log file more than 2GB in small database

Hi2all,
I have some trouble with shrinking log file. No more user is connected
on this database. According to dbcc loginfo command log file is just
made up with active log. Here is the result
FileId_FileSize_____ StartOffset FSeqNo Status
Parity CreateLSN
2 1186201600 8192 15 2 128 0
2 1186201600 1186209792 16
2 64 0
I don't know why it remains so much space in active log because no
transaction is applied.
Can someone help me ?
Mo
--
Mo
Posted via http://dbforums.comSee
http://support.microsoft.com/default.aspx?scid=kb;en-
us;272318
http://support.microsoft.com/default.aspx?scid=kb;en-
us;256650
(and the references at the botom)
Do you have the database in full recovery mode and are you
taking log backups
If yes and no then set it to simple and read about backup
strategies in bol.

Sunday, February 19, 2012

Cannot set Default value for column using "Alter column"

Well here's one of those excruciatingly simple obstacles:

In SQL Server 2005 (Mgmt Studio): according to BOL, the syntax to set a default value for an existing column is:

ALTER TABLE MyCustomers ALTER COLUMN CompanyName SET DEFAULT 'A. Datum Corporation'

However, when I Check:

alter table CommissionPayment alter column Amount Set Default 0

I get the error message:

"Incorrect syntax near the keyword 'Set'."

No other combinations of this syntax work.

Help! What am I missing?? DEFAULT is not a column property in T-SQL -- it's actually implemented as a constraint. The correct syntax is: CREATE TABLE #x (id int) ALTER TABLE #x ADD CONSTRAINT DF_id DEFAULT (0) FOR id Where in BOL did you see that syntax? -- Adam MachanicPro SQL Server 2005, available nowhttp://www..apress.com/book/bookDisplay.html?bID=457-- <Karl Kaiser@.discussions.microsoft.com> wrote in message news:a5caf4ff-8884-4383-960f-b4f61aad2da2@.discussions.microsoft.com...Well here's one of those excruciatingly simple obstacles:In SQL Server 2005 (Mgmt Studio): according to BOL, the syntax to set a default value for an existing column is:[b]ALTER TABLE MyCustomers ALTER COLUMN CompanyName SET DEFAULT 'A. Datum Corporation'[/b]However, when I Check:[b]alter table CommissionPayment alter column Amount Set Default 0[/b]I get the error message:[b]"Incorrect syntax near the keyword 'Set'."[/b]No other combinations of this syntax work.Help! What am I missing?|||The syntax you saw was for SQL Server Mobile Edition. It is not applicable for the other SQL Server editions. So the correct way is to add default as a constraint using syntax posted by Adam.