Releasing Space Using Commands

Feb 21, 2008

Hi,

I have 250 mb allocated on my db.

I have two main tables which are taking up the most space

name rows reserved data index_size unused

aspnet_Users 79225 48280 KB 23080 KB 25080 KB 120 KB

aspnet_Profile 69228 132680 KB 131456 KB 568 KB 656 KB


When i deleted some 8000 rows from aspnet_profile, some space should have been released. On the contrary, the db size increased. Where did the space go and why did the db size increase after deleting the records? There are no triggers either.

I thought it might be log files..but my hosting provider tells me that db is set to Simple Recovery which does not utilize a Log File. So we cannot shrink it.

Any idea how can i release some space. Does truncating a table release db space and not fill the log?

Please guide step by step. I am not very thorough with sql

thankls

View 2 Replies


ADVERTISEMENT

Log File Shrink Not Releasing The Space On Disk

Oct 4, 2007

Hi all

My Transactional log size increased to 39GB, it is in full recovery mode,

To regain the space, i have done the following
BACKUP LOG DB_NAME WITH TRUNCATE_ONLY
DBCC SHRINK_FILE (LOG_FILE_NAME,500)
But not able to regain the space in the hard disk.

No Transactional backups to truncate the log file were setup.

Can you please tell me why the space was released and what should i do further to clean up the sapce

View 4 Replies View Related

What Is Going On Here? SQL Commands And ODBC Commands Aren't Compatible

Oct 1, 2004

I'm building a simple webform, except Visual Studio and my service provider have combined to drive me nutty.

First, I MUST use an ODBC connection to my remote SQL Server do to some unknown configuartion problem. I've been playing with Visual Studio for only a month, so normally when something goes wrong I can go look in the mirror and find the culprit. This is different. I've got a totally functional web form with a SQL Connection, but when I try to change it to an ODBC Connection, I get the following error.

An OdbcParameter with ParameterName '@CertHolder' is not contained by this OdbcParameterCollection

My coding is fine because I stole it straight from the walkthrough and it works. But the specifications that Visual Studio provide are quite suspect. Please note the failure to include some key "@" signs.


#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection
Me.cmdUpdate = New System.Data.SqlClient.SqlCommand
Me.cmdGetAll = New System.Data.SqlClient.SqlCommand
Me.cmdSelect = New System.Data.SqlClient.SqlCommand
Me.OdbcConnection1 = New System.Data.Odbc.OdbcConnection
Me.OdbcGetAll = New System.Data.Odbc.OdbcCommand
Me.OdbcSelect = New System.Data.Odbc.OdbcCommand
Me.OdbcUpdate = New System.Data.Odbc.OdbcCommand
'
'SqlConnection1
'
Me.SqlConnection1.ConnectionString = "this works fine"
'
'cmdUpdate
'
Me.cmdUpdate.CommandText = "UPDATE InsuranceData SET Name = @Name, Address = @Address, Address2 = @Address2, " & _
"City = @City, State = @State, Zip = @Zip, CertHolder = WHERE (CertHolder = @Cert" & _
"Holder)"
Me.cmdUpdate.Connection = Me.SqlConnection1
Me.cmdUpdate.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Name", System.Data.SqlDbType.NVarChar, 50, "Name"))
Me.cmdUpdate.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Address", System.Data.SqlDbType.NVarChar, 50, "Address"))
Me.cmdUpdate.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Address2", System.Data.SqlDbType.NVarChar, 50, "Address2"))
Me.cmdUpdate.Parameters.Add(New System.Data.SqlClient.SqlParameter("@City", System.Data.SqlDbType.NVarChar, 50, "City"))
Me.cmdUpdate.Parameters.Add(New System.Data.SqlClient.SqlParameter("@State", System.Data.SqlDbType.NVarChar, 50, "State"))
Me.cmdUpdate.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Zip", System.Data.SqlDbType.NVarChar, 50, "Zip"))
Me.cmdUpdate.Parameters.Add(New System.Data.SqlClient.SqlParameter("@CertHolder", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CertHolder", System.Data.DataRowVersion.Original, Nothing))
'
'cmdGetAll
'
Me.cmdGetAll.CommandText = "SELECT CertHolder, Name, Address, Address2, City, State, Zip FROM InsuranceData"
Me.cmdGetAll.Connection = Me.SqlConnection1
'
'cmdSelect
'
Me.cmdSelect.CommandText = "SELECT CertHolder, Name, Address, Address2, City, State, Zip FROM InsuranceData W" & _
"HERE (CertHolder = @CertHolder)"
Me.cmdSelect.Connection = Me.SqlConnection1
Me.cmdSelect.Parameters.Add(New System.Data.SqlClient.SqlParameter("@CertHolder", System.Data.SqlDbType.NVarChar, 50, "CertHolder"))
'
'OdbcConnection1
'
Me.OdbcConnection1.ConnectionString = "This works fine"
'
'OdbcGetAll
'
Me.OdbcGetAll.CommandText = "SELECT CertHolder, Name, Address, Address2, City, State, Zip FROM InsuranceData"
Me.OdbcGetAll.Connection = Me.OdbcConnection1
'
'OdbcSelect
'
Me.OdbcSelect.CommandText = "SELECT CertHolder, Name, Address, Address2, City, State, Zip FROM InsuranceData W" & _
"HERE CertHolder = @CertHolder"
Me.OdbcSelect.Connection = Me.OdbcConnection1
Me.OdbcSelect.Parameters.Add(New System.Data.Odbc.OdbcParameter("CertHolder", System.Data.Odbc.OdbcType.NVarChar, 50, "CertHolder"))
'
'OdbcUpdate
'
Me.OdbcUpdate.CommandText = "UPDATE InsuranceData SET Name = @Name, Address = @Address, Address2 = @Address2, " & _
"City = @City, State = @State, Zip = @Zip WHERE CertHolder = @CertHolder"
Me.OdbcUpdate.Connection = Me.OdbcConnection1
Me.OdbcUpdate.Parameters.Add(New System.Data.Odbc.OdbcParameter("Name", System.Data.Odbc.OdbcType.NVarChar, 50, "Name"))
Me.OdbcUpdate.Parameters.Add(New System.Data.Odbc.OdbcParameter("Address", System.Data.Odbc.OdbcType.NVarChar, 50, "Address"))
Me.OdbcUpdate.Parameters.Add(New System.Data.Odbc.OdbcParameter("Address2", System.Data.Odbc.OdbcType.NVarChar, 50, "Address2"))
Me.OdbcUpdate.Parameters.Add(New System.Data.Odbc.OdbcParameter("City", System.Data.Odbc.OdbcType.NVarChar, 50, "City"))
Me.OdbcUpdate.Parameters.Add(New System.Data.Odbc.OdbcParameter("State", System.Data.Odbc.OdbcType.NVarChar, 50, "State"))
Me.OdbcUpdate.Parameters.Add(New System.Data.Odbc.OdbcParameter("Zip", System.Data.Odbc.OdbcType.NVarChar, 50, "Zip"))
Me.OdbcUpdate.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_CertHolder", System.Data.Odbc.OdbcType.NVarChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CertHolder", System.Data.DataRowVersion.Original, Nothing))

I NEVER EVER TYPED ORIGINAL_CERTHOLDER IN THE SQL PREPARATION

End Sub
Protected WithEvents btnSave As System.Web.UI.WebControls.Button
Protected WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
Protected WithEvents ddlCertHolder As System.Web.UI.WebControls.DropDownList
Protected WithEvents txtName As System.Web.UI.WebControls.TextBox
Protected WithEvents txtAddress As System.Web.UI.WebControls.TextBox
Protected WithEvents ddlCH As System.Web.UI.WebControls.DropDownList
Protected WithEvents cmdUpdate As System.Data.SqlClient.SqlCommand
Protected WithEvents cmdGetAll As System.Data.SqlClient.SqlCommand
Protected WithEvents cmdSelect As System.Data.SqlClient.SqlCommand
Protected WithEvents txtAddress2 As System.Web.UI.WebControls.TextBox
Protected WithEvents txtCity As System.Web.UI.WebControls.TextBox
Protected WithEvents txtState As System.Web.UI.WebControls.TextBox
Protected WithEvents txtZip As System.Web.UI.WebControls.TextBox
Protected WithEvents OdbcConnection1 As System.Data.Odbc.OdbcConnection
Protected WithEvents OdbcGetAll As System.Data.Odbc.OdbcCommand
Protected WithEvents OdbcSelect As System.Data.Odbc.OdbcCommand
Protected WithEvents OdbcUpdate As System.Data.Odbc.OdbcCommand

'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region


Comments? Suggestions, I am not positive about how to fix this.

View 2 Replies View Related

Releasing Memory

May 13, 2008

My application is a VB.net client server app with SQL Express on the backend, for some reason both my SQL server and Application continue to increase their memory usage over time, every procedure utilizes the close method of the sqlconnection and then sets the sqlconnection to nothing. Is there anything else I should be doing to close the connection and prevent this memory increase?

View 2 Replies View Related

SQLSRVR.EXE Not Releasing Memory

Sep 3, 2000

Has anyone ever seen a situation where SQLSRVR.EXE starts gobbling RAM when under load but does not seem to release it (as seen by mem usage under Task Manager or the related PerfMon counters?) I am running a test of 4 client applications that are hammering against the server but when I check the stats memory is consumed up to the maximum - when I halt the client applications and reduce the processing load to zero the usage stats still show the SQL engine as holding the memory.

I'm running a copy of SQL 7.0 EE on Win2K Advanced Server, using a Compaq 8500 w/ 750MB RAM.

Any clues?

Thanks,
A

View 1 Replies View Related

SQL Server Is Not Releasing Extended SP DLL

Nov 3, 2006

During a Wise Installation upgrade of our software, we are renaming a
directory that contains our ExtendedSP DLL. We issue a
DBCC TSWSQLXP(Free) call before doing the rename, yet SQL Server,
still "holds on" to that DLL. We install a new version, and the ListDLLs
utility (from sysinternals) lists the new DLL in the correct directory.

However, when trying to remove the renamed directory, it won't let us
remove the old DLL because it says it is in use. We can delete the NEW
DLL in the NEW directory with no problem.

I have run the DBCC call numerous times and SQL Server STILL won't
release the DLL for deletion. The only way to delete the OLD DLL is to
stop the SQL Server, delete the DLL, and then restart SQL Server. We
do NOT want to do this because there may be other processes running in
SQL Server.

Any help here would be greatly appreciated.

View 4 Replies View Related

Memory Releasing Problem

Feb 6, 2007

vighnahar writes "I am using SQL server 2000 / 2005
If I run any query on SQL server it is using some memory for it’s execution but not releasing it’s memory after completion on SQL query. This is giving a problem in my application. Where for each user it is consuming 400 MB RAM on SQL server. after login of fifteen users server is getting slow.
Is there any way by which I can release memory of SQL server as I don’t want SQL server to keep it’s result etc in memory, So that I can use this memory for other processing.

I am writing sample code of VB6 to check for memory utilization. After clicking on button you can observer memory in task manager.

Private Sub Command1_Click()
Dim con As ADODB.Connection
Dim sSql As String
Dim Rs As New ADODB.Recordset
Set con = New ADODB.Connection
con.Open "Upcrest", "sa", ""
Rs.Open " select * from sientity ", con
MsgBox Rs.Source
Rs.Close
Set Rs = Nothing
con.Close
Set con = Nothing
End Sub"

View 1 Replies View Related

Releasing Memory - Dispose Or Update

Mar 8, 2007

i am using visual web developer 2005 and SQL Express 2005 with VB as the code behindi am using the following code to update the database table         Dim update As New SqlDataSource()        update.ConnectionString = ConfigurationManager.ConnectionStrings("DatabaseConnectionString").ToString()        update.UpdateCommandType = SqlDataSourceCommandType.Text        update.UpdateCommand = "UPDATE orderdetail SET fromdesignstatus = 2 ,progresspercentage = 15 , fromdesignlink = '" +                                                                      designlink + "' WHERE order_id =" + ordersid.ToString()        update.Update()        update.Dispose()        update = Nothing  i am using update.Dispose()  and update = nothing to release the memoryis it really necessary to use both the commandsif not , in my case which one is enough and what is the reasonplease help me 

View 3 Replies View Related

Class That Uses Sql Server Isn't Releasing Memory

May 15, 2006

I'm running into a problem where the class I'm running seems to eat up a lot of memory with sql server.  When it's done running, the memory usage never goes down in taskmanager.  I can't figure out where the memory leak might be.  Here's the code that is being called.  Does anyone see a reason why it would continue to eat memory as it runs and then not release it?  Thanks.
 using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace QueryLoadTester
{
class JobSeeker
{
private string ConStr = @"Data Source=server;Initial Catalog=db;Integrated Security=True";

public JobSeeker() { }

#region UpdateJobSeeker
public void UpdateJobSeeker(string JobSeekerId)
{
string qry = "SELECT top 100 dbo.JobSeeker.JobSeekerID, dbo.JobSeeker.SiteId, dbo.JobSeeker.PositionTitle, dbo.JobSeeker.LocationID, dbo.JobSeeker.CurrentSalary, " +
"dbo.JobSeeker.DesiredSalary, dbo.JobSeeker.MinSalary, dbo.JobSeeker.CurrentHourly, dbo.JobSeeker.MinHourly, dbo.JobSeeker.Comments, " +
"dbo.JobSeeker.Resume, dbo.JobSeeker.WillRelocate, dbo.JobSeeker.DateAdded, dbo.JobSeeker.LastModified FROM dbo.JobSeeker " +
"where dbo.JobSeeker.Active=1 and dbo.JobSeeker.samplejobseeker=0 ";

if (JobSeekerId.Length > 0)
qry += " and dbo.JobSeeker.JobSeekerID=" + JobSeekerId;

qry += " and dbo.JobSeeker.JobSeekerID not in (Select JobSeekerId from JobSeekerFullTextSearch)";

SqlConnection cnInsert = new SqlConnection(ConStr);
SqlDataAdapter adp = new SqlDataAdapter(qry, cnInsert);
cnInsert.Open();
DataSet dsJobSeekers = new DataSet();
adp.Fill(dsJobSeekers);
adp.Dispose(); adp = null;


if (dsJobSeekers.Tables[0].Rows.Count > 0)
{
string jid = string.Empty;
string degree, degreegroup;
StringBuilder sb = new StringBuilder();
SqlCommand cmdInsert = new SqlCommand();
cmdInsert.Connection = cnInsert;

foreach (DataRow dr in dsJobSeekers.Tables[0].Rows)
{
jid = dr["JobSeekerID"].ToString();

if (JobSeekerId.Length > 0)
{
cmdInsert.CommandText = "Delete from JobSeekerFullTextSearch where JobSeekerId=" + JobSeekerId;
cmdInsert.ExecuteNonQuery();
}

DataSet dsExtras = GetJobSeekerExtras(jid, cnInsert);

SqlTransaction trans = cnInsert.BeginTransaction();
cmdInsert.Transaction = trans;

degree = degreegroup = string.Empty;

#region insert record into fulltextsearch
try
{
sb.Remove(0, sb.Length);
sb.Append("Insert into JobSeekerFullTextSearch (JobSeekerId, PositionTitle, LocationID, CurrentSalary, ");
sb.Append("DesiredSalary, MinSalary, CurrentHourly, MinHourly, CommentsResume, SiteId, WillRelocate, DateAdded, LastModified) values (");
sb.Append(jid);
sb.Append(",'");
sb.Append(dr["PositionTitle"].ToString().Replace("'", "''"));
sb.Append("',");
sb.Append("'");
sb.Append(dr["LocationID"].ToString().Replace("'", "''"));
sb.Append("',");
sb.Append(Nullify(dr["CurrentSalary"]));
sb.Append(",");
sb.Append(Nullify(dr["DesiredSalary"]));
sb.Append(",");
sb.Append(Nullify(dr["MinSalary"]));
sb.Append(",");
sb.Append(Nullify(dr["CurrentHourly"]));
sb.Append(",");
sb.Append(Nullify(dr["MinHourly"]));
sb.Append(",'");
sb.Append(dr["Comments"].ToString().Replace("'", "''"));
sb.Append(" ");
sb.Append(dr["Resume"].ToString().Replace("'", "''"));
sb.Append("',");
sb.Append(dr["SiteId"].ToString());
sb.Append(",");
sb.Append(Convert.ToInt32(Convert.ToBoolean(dr["WillRelocate"].ToString())));
sb.Append(",'");
sb.Append(dr["DateAdded"].ToString());
sb.Append("','");
sb.Append(dr["LastModified"].ToString());
sb.Append("')");

cmdInsert.CommandText = sb.ToString();

cmdInsert.ExecuteNonQuery();

#region dsExtras insert
//degree info
if (dsExtras.Tables.Count > 0 && dsExtras.Tables[0].Rows.Count > 0)
{
degree = dsExtras.Tables[0].Rows[0][0].ToString();
degreegroup = dsExtras.Tables[0].Rows[0][1].ToString();

if (degree.Length > 0 || degreegroup.Length > 0)
{
sb.Remove(0, sb.Length);
sb.Append("Update JobSeekerFullTextSearch set DegreeLevel='");
sb.Append(degree);
sb.Append("', DegreeLevelGroup=");
sb.Append(degreegroup);
sb.Append(" where JobSeekerId=");
sb.Append(jid);
cmdInsert.CommandText = sb.ToString();
cmdInsert.ExecuteNonQuery();
}
}

//disciplines info
if (dsExtras.Tables.Count > 1 && dsExtras.Tables[1].Rows.Count > 0)
{
sb.Remove(0, sb.Length);

foreach (DataRow d in dsExtras.Tables[1].Rows)
{
sb.Append(d[0].ToString());
sb.Append(",");
}
if (sb.ToString().Length > 0)
{
cmdInsert.CommandText = "Update JobSeekerFullTextSearch set DisciplineIdList='" + sb.ToString().Substring(0, sb.ToString().Length - 1) + "' where JobSeekerId=" + jid;
cmdInsert.ExecuteNonQuery();
}
}

//industries info
if (dsExtras.Tables.Count > 2 && dsExtras.Tables[2].Rows.Count > 0)
{
sb.Remove(0, sb.Length);

foreach (DataRow d in dsExtras.Tables[2].Rows)
{
sb.Append(d[0].ToString());
sb.Append(",");
}
if (sb.ToString().Length > 0)
{
cmdInsert.CommandText = "Update JobSeekerFullTextSearch set IndustryIdList='" + sb.ToString().Substring(0, sb.ToString().Length - 1) + "' where JobSeekerId=" + jid;
cmdInsert.ExecuteNonQuery();
}
}


//jobtypes info
if (dsExtras.Tables.Count > 3 && dsExtras.Tables[3].Rows.Count > 0)
{
sb.Remove(0, sb.Length);

foreach (DataRow d in dsExtras.Tables[3].Rows)
{
sb.Append(d[0].ToString());
sb.Append(",");
}
if (sb.ToString().Length > 0)
{
cmdInsert.CommandText = "Update JobSeekerFullTextSearch set JobTypeIdList='" + sb.ToString().Substring(0, sb.ToString().Length - 1) + "' where JobSeekerId=" + jid;
cmdInsert.ExecuteNonQuery();
}
}
#endregion

trans.Commit();
Console.WriteLine("Insert for " + jid);
}
catch (Exception exc)
{
trans.Rollback();
Console.WriteLine(jid + " - " + exc.ToString());
}
finally
{
trans.Dispose(); trans = null;
}
#endregion

dsExtras.Clear(); dsExtras.Dispose(); dsExtras = null;

}//end foreach
cmdInsert.Dispose(); cmdInsert = null;
}
cnInsert.Close(); cnInsert.Dispose(); cnInsert = null;
GC.Collect();
}
#endregion

#region GetJobSeekerExtras
private static DataSet GetJobSeekerExtras(string JobSeekerId, SqlConnection cn)
{
string qry = "Select JobSeekerDegree.DegreeLevel, VDegreeLevels.DegreeGroup from JobSeekerDegree inner join " +
" VDegreeLevels on JobSeekerDegree.DegreeLevel=VDegreeLevels.DegreeLevel where JobSeekerId=" + JobSeekerId + ";" +
"Select DisciplineID from JobSeekerDiscipline where JobSeekerId=" + JobSeekerId + ";" +
"Select IndustryID from JobSeekerIndustry where JobSeekerID=" + JobSeekerId + ";" +
"Select JobTypeID from JobSeekerJobType where JobSeekerID=" + JobSeekerId;

DataSet ds = new DataSet();
SqlDataAdapter adp = new SqlDataAdapter(qry, cn);
adp.Fill(ds);
adp.Dispose(); adp = null;
return ds;

}
#endregion

#region Nullify
private static string Nullify(object p)
{
if (p != System.DBNull.Value)
return p.ToString();
else
return "null";
}
#endregion
}
}

View 5 Replies View Related

Sql Server 2005 Queries Start Timing Out Because Sa Is Acquriing And Releasing Locks

Oct 23, 2007

I have a co-worker whose sql server 2005 is exhibiting strange behavior. We have already re-installed sql server 2005 and service packed it to SP2 to try and see if the behavior stops but it has not.

Every so often during the day sql server 2005 will start to slow down to the point that my co-worker's queries begin to time out. He turned on profiler to look at what was going on behind the scenes.

We see where sa is releasing and acquring locks to the tune of 180,000 rows in a fifteen minute span when this behavior starts so does his time outs. He has reporting options and analysis services installed but not configured. His only connection is to his local database. Occasionally, you see a number like - (03000d8f0ecc) appear in the Text Data column in profiler for sa. I read something about reporting options using sa for clean up but I don't think that is what is happening here.

Does someone have a clue as to what is happening and a way we can prevent the behavior? It is affecting his ability to work on his application.

Thx

View 1 Replies View Related

How To Replace Empty Space Or White Space In A String In A Stored Procedure

Nov 14, 2007

Hi,
 I am trying to do this:
UPDATE Users SET  uniqueurl = replaceAllEmptySpacesInUniqueURL('uniqueurl')
What would be the syntax.
Any help appreciated.
Thanks
 

View 1 Replies View Related

Mutilple Space Gets Converted To Single Space In Report Viewer Control

Feb 23, 2007

I am generating a Report from Sql Data Source in Sql Server 2005 and viewing the Report in Report viewer control of Visual Studio 2005.
The data in the Data Source contains string with multiple spaces (for example €œ Test String €œ) but when they get rendered in Report viewer control, multiple spaces gets converted to single space €? Test String €œ.

I tried following solutions
1) Replacing spaces with €œ&nbsp;€?
2) Inserting <pre> tag before the string and </pre> tag after the string (Also tried &lt;Pre&gt; instead of <pre>)

But in all the cases result is same. The Report Viewer control is showing €œ&nbsp€? instead of space and €œ<Pre>€? tag instead of preserving spaces.

Please provide me a solution so that spaces can be preserved in Report Viewer.

View 1 Replies View Related

Transact SQL :: How To Find Space Available Or Send Space Alerts In Percentage

Nov 26, 2015

I am using the below script to get space alerts  and now i am interested in sending alerts  if for any drive space available is Less than 10% or 15%.. how to convert beelow code to find in % 

Declare @Drives Varchar(20)
DECLARE @Spaces Varchar(50)
DECLARE @availableSpace FLOAT
DECLARE @alertMessage Varchar(4000)
DECLARE @RecipientsList  VARCHAR(4000);
CREATE TABLE #tbldiskSpace

[Code] ....

View 3 Replies View Related

Trans Log-&>space Allocated 27GB, Space Used 100MB

Mar 2, 2005

Hi.. I was doing a good maintenance on my DB and my trans log LDF keep growing until 30GB but my DB data file MDF is only 2GB. I found the two following method to reduce my log size.

Method 1: I used veritas to backup log file with truncate
Method 2: I used the shrink database option in Enterprises manager to shrink it (file chosen=log , use default option)

After doing that, I found my LDF log file is still about the same size=27GB but when I see clearly, from the shrink database windows, the log spaced used reduced to only 100MB, the allocation log space is still 27GB. Why? How to make the LDF smaller to be the around the same size as the space used 100MB?

View 1 Replies View Related

Double Space Replaced With Single Space By Dbms ??!

Jul 20, 2005

This is driving me bananas. Can't find any info on this anywhere....SQL 2000 seems to replace double space with a single space when I seta varchar field to " " (2spaces), it only stores " " (1space). Whyon earth would microsoft do this? If I save 2 spaces - I WANT TO SEE2 SPACES!!!!Can anyone help? Is this a database setting? Is this due to usingvarchar?Any help appreciated.Colin Hale

View 2 Replies View Related

Problem With Space Allocated For Transaction Log Space

Dec 5, 2001

Hello,

Somebody know how to reduce the space allocated for the transaction log space for my SQL_DB ?

3700 MB allocated but only 100 MB used and 3600 MB are free !

Transaction log properties :
Automatically grow file are filled
file growth by percent = 5%
maximum file size - restrict filegrowth = 3700 MB (we can't reduce it !)

Thank you for your precious help !
Khaix from Brussel.

View 1 Replies View Related

Suppress Multiple Space To Single Space..

Nov 14, 2006

How do we suppress multiple spaces to a single space in T-SQL

E.G.

Field: FullName

e.g.

WOMENS HEALTH RIVER VALLEY
JOHN FAMILY MED GROUP
HERSH STWEART P.
PARK HEIGHTS MEDICAL CENTER
KOPP WHITEFIELD E

The o/p wanted is

HERSH STWEART P.



Thank you.


View 3 Replies View Related

SQL Server Memory Not Releasing When Not Connected To Server

Jun 2, 2004

Hello all,

When I close a web form that has a connection to my SQL Server, I am not seeing the memory process close in task manager (of the SQL Server). I am using the "open late close early" theory of database connections. I am using the "close" method for my database connections. Is there any automated utility that will shut down these processes? I thought when the user was disconnected from the database, the memory process would automatically shut down.

Any suggestions, thoughts, or ideas?

TYIA,
lonelobo

View 1 Replies View Related

Update - Not Releasing The Lock After Update

Sep 16, 1999

Pls. help me,

How can I kill the LOCK after update is completed in the table?

My application is complaining that other user still using the system.


This is a part of my trigger to do un update on CallLog table

.......
begin transaction
Update Heat.CallLog
set ModTime=@Vancovertime Where CallID=@strCallID
Commit Transaction

View 1 Replies View Related

Commands

Jan 7, 2008

Hi All,

I have these two commands that I execute at the end of my stored procedure. I get an email every time I execute this stored procedure whether the select statement returns a value or not. But I only want to get an email if select statement returns an Error value. How can I accomplish this?

set @cmd = 'osql -S server -U user -P psswd -q "set nocount on; select distinct(rtrim(col1)) from ##table where datediff(dd,col2,getdate()) = 1 and (col1 like ''%Error: %'')" -h-1 -w 1025 -o J:MyFolderErrorLogMsg.txt'

EXEC master.dbo.xp_cmdshell @cmd, no_output

SET @email = 'mailsend -f someone@mymail.com -d -smtp -t someone@mymail.com -sub "Error Log Errors" -m J:MyFolderErrorLogMsg.txt'

EXEC master.dbo.xp_cmdshell @email, no_output


Thanks.

View 2 Replies View Related

Commands

Jan 7, 2008

Hi All,

I have these two commands that I execute at the end of my stored procedure. I get an email every time I execute this stored procedure whether the select statement returns a value or not. But I only want to get an email if select statement returns an Error value. How can I accomplish this?

set @cmd = 'osql -S server -U user -P psswd -q "set nocount on; select distinct(rtrim(col1)) from ##table where datediff(dd,col2,getdate()) = 1 and (col1 like ''%Error: %'')" -h-1 -w 1025 -o J:MyFolderErrorLogMsg.txt'

EXEC master.dbo.xp_cmdshell @cmd, no_output

SET @email = 'mailsend -f someone@mymail.com -d -smtp -t someone@mymail.com -sub "Error Log Errors" -m J:MyFolderErrorLogMsg.txt'

EXEC master.dbo.xp_cmdshell @email, no_output


Thanks.

View 2 Replies View Related

Sql Commands

Jan 13, 2004

How can I get all SQL commands in SqlServer? How can I trace this commands?

Thansk

View 1 Replies View Related

SET Commands

Feb 8, 2006

Hello,

I finally got access to Northwind/pubs.

I would like to know when and why do we use the following set commands. The SQL Server BOL does not say why and when to use these commands.

Thanks in advance!!!
sqlnovice123



Option Default Setting
Set nocount OFF
Set rowcount 0
Set ansi_nulls ON
Set quoted_identifier ON

View 3 Replies View Related

2 SQL Commands In One Action

Nov 29, 2007

Hi guys,I wanna ask bout the problem with my web application. I'm doing a select a statement from table 1 and and with the query results i got, i need it to store the result on table 2. How will i do this?  I need your tips and suggestions.

View 1 Replies View Related

Multiple SQL Commands At Once

Jan 8, 2006

I'm running asp.net 2.0 and acessing MSSQL 2K.  I am trying to run a query in which I need to set up variables first.  I tried the following group of commands as shown, passing it to the  SqlDataReader object, but it failed.. does anyone know how i can pass multiple SQL commands?         MainQuery = "declare @MinGrades as Table(GradeID Bigint) " & _                    " INSERT @MinGrades SELECT MIN(CreditGrades.SplitID) AS Expr1" & _                       "  FROM          CreditGrades INNER JOIN" & _                        "    CreditGradeSplits ON CreditGradeSplits.CreditGradeSplitID = CreditGrades.SplitID " & _                        " WHERE      (CreditGrades.x0x30 = - 1 OR " & _                        "    CreditGrades.x0x30 >= 0) AND (CreditGrades.x1x30 = - 1 OR " & _                        "    CreditGrades.x1x30 >= 0) AND (CreditGrades.x2x30 = - 1 OR " & _                        "    CreditGrades.x2x30 >= 0) AND (CreditGrades.x3x30 = - 1 OR " & _                        "    CreditGrades.x3xNOD >= 0) " & _                        " GROUP BY CreditGradeSplits.CreditGradeGroupID" & _                    " Select * from @MinGrades "

View 2 Replies View Related

SQL Commands Disappearing!?!?!?!

Nov 7, 2001

I am experiencing a situation where I issue a lengthy SQL command to MS SQL Server 7.0 through MTS and it "disappears" - no errors or recordsets are returned. The command is "SELECT * FROM CUSTOMERS WHERE LASTNAME LIKE 'SMITH%'". When I issue this command from SQL Query Analyzer it takes 27 seconds to return 87 rows. When I issue this exact same command through MTS it does not return at all.

I've used the SQL Profiler to analyze the requests. It shows the commands from MTS starting but they never stop (or at least the profiler never reports them as stopping). The same commands coming from Query Analyzer are reported as starting and stopping without fail.

Here's a twist: I can issue less demanding commands (ie, one that doesn't take so long to process) through MTS and they come back fine. For example, when a user logs into my application, I use an SQL statement to verify the user name and password and status the user as logged in. This is routed through MTS and it comes back fine in less than a second. Same application, same PC, same MTS and SQL server, same SQL database. The only difference is that the CUSTOMERS table has over 800,000 records and the USERS table has only 5 records.

PLEASE HELP!

View 1 Replies View Related

Using The DBCC Commands

Jul 26, 2004

Hi,

I am very new to sql server and I have been reading up on the dbcc commands. For instance, DBCC SHOWCONTIG where do I execute this command? I went into the cmd prompt and opened osql and typed:
1> DBCC SHOWCONTIG
2> GO

This gives me the information for what I assume is the master database. But, how do I use this command under the other databases?

Also, I have been trying to learn how to determine when to do index maintenance by using the index tuning wizard. But, I don't know what a workload is. Can someone point me in the right direction or give me some information about this topic.

Thanks,
Laura

View 5 Replies View Related

Normalizing Using Sql Commands

Aug 28, 2006

Hi

Please can someone point me in the direction, i built a very badly designed database consisting of only one huge table when i first started databases, since learning about normalization i have designed and set up a new database which consists of many more tables instead of just the one. My question is where do i start in transfering the data from the old single tabled database to my new multi-tabled database?

I have MS SQL server 2005 managment studio if that helps, but want to transfer around 200,000 rows of data into the new database. Both new and old databases are on the same server.

thanks in advance

View 11 Replies View Related

Run Commands Only Between Hours

Feb 29, 2012

I have a job that runs between the hours of 10 PM and 9 AM. It launches a controller stored procedure that will call other stored procedure until the entire process is done.I would like the controlling stored procedure to only call the steps between the hours of 10PM and 9AM also.. So at 8:59 AM it will start the next step, but at 9:00 AM it will exit.

View 6 Replies View Related

Undeleveired Commands

Nov 4, 2007

hi all
when i set up a new subcription ,i notice in hte replication monitor thet this subscription 'uninitialize subscription' and the are 70 undelevier commands.

how can i fixed this problem,or how can i remove those undeleveirs commands?

thanx

View 1 Replies View Related

Log All Commands Executed In QA

Jul 23, 2005

Hi All,Is there way that commands executed in the query analyzer get loggedautomatically?TIAJoriz

View 3 Replies View Related

Output Of Sql Commands

May 19, 2006

Hi,

Suppose there are two tables employee and salary and a,b are two instances of tables employee and salary.There are 20 records in each table.Then what will be the result of the following query



select a.*, b.* from employee a, salary b.

regards

arun



View 3 Replies View Related

Commands That Cannot Be Used With Mirroring

Feb 6, 2007

Hi al,



Are there commands that are not supported when mirroring is active? (truncate table, bcp, set identity insert on/off etc.)







View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved