|
Hi,
How can I read the database physical file size?
|
|
|
|
|
You need to query the information_schema database, for this and your other posts. Can I suggest you install a graphical front end for MySQL (I'd recommend HeidiSQL[^]) - apart form showing you all you need to know about this, you can view the SQL it uses to query the database in it's output window.
|
|
|
|
|
|
Hi,
How can I get the server properties in mysql, for example, physical size?
Regards,
|
|
|
|
|
Hi,
I have a website with a textbox.. user will write the sql query in the textbox.. how can I execute the code on mysql?
Thanks,
|
|
|
|
|
With crossed fingers.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
I suggest you read up on SQL Injection
|
|
|
|
|
That's not a good practice But If you want to go ahead with this only then I can provide you little suggestion.
Just Put you query inside Execute() and give SqlCommand To Execute .
|
|
|
|
|
Very simple, you need to embedded texts of textbox in the paramater of SQLCommand function and then pass connection object and then Execute it.
|
|
|
|
|
Hi,
I tried it and it's working BUT it's just executing the first query so f i type any other quesry it will just show the first query result with no error unless i signout my application or restart it.. why is this?
here is the code:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Panel runat="server" ID="panelError" BorderWidth="1" BorderColor="Red" style="padding:10px" Visible="false" BorderStyle="Solid" HorizontalAlign="Left">
<dxe:ASPxLabel ID="lblErrorTitle" runat="server" Text="Error" Font-Bold="true" ForeColor="Red" /><br /><br />
<dxe:ASPxLabel ID="lblErrorDetails" runat="server" Text="" />
</asp:Panel>
<dxtc:ASPxPageControl ID="ASPxPageControl1" runat="server" ActiveTabIndex="0" Height="250px" Width="100%">
<TabPages>
<dxtc:TabPage Text="Query Editor" TabStyle-HorizontalAlign="Center" TabStyle-VerticalAlign="Middle">
<Controls>
<dxe:ASPxMemo ID="txtQuery" runat="server" Height="200px" Width="100%" /><br /><br />
<asp:Button runat="server" ID="btnExecute" Width="100px" Text="Execute" OnClick="btnExecute_Click" />
</Controls>
</dxtc:TabPage>
</TabPages>
</dxtc:ASPxPageControl>
<br /><br />
<dxwgv:ASPxGridView ID="gridQuery" runat="server" AutoGenerateColumns="True"
CssFilePath="~/App_Themes/Plastic Blue/{0}/styles.css" CssPostfix="PlasticBlue"
Width="100%">
<Columns />
<Images ImageFolder="~/App_Themes/Plastic Blue/{0}/">
<CollapsedButton Height="9px"
Url="~/App_Themes/Plastic Blue/GridView/gvCollapsedButton.png" Width="9px" />
<ExpandedButton Height="9px"
Url="~/App_Themes/Plastic Blue/GridView/gvExpandedButton.png" Width="9px" />
<HeaderSortDown Height="11px"
Url="~/App_Themes/Plastic Blue/GridView/gvHeaderSortDown.png" Width="11px" />
<HeaderSortUp Height="11px"
Url="~/App_Themes/Plastic Blue/GridView/gvHeaderSortUp.png" Width="11px" />
</Images>
<SettingsPager ShowDefaultImages="False" PageSize="30">
<AllButton Text="All">
</AllButton>
<NextPageButton Text="Next >">
</NextPageButton>
<PrevPageButton Text="< Prev">
</PrevPageButton>
</SettingsPager>
<Styles CssFilePath="~/App_Themes/Plastic Blue/{0}/styles.css"
CssPostfix="PlasticBlue">
<Header ImageSpacing="10px" SortingImageSpacing="10px">
</Header>
</Styles>
<SettingsBehavior AllowDragDrop="False" AllowGroup="False" />
</dxwgv:ASPxGridView>
</ContentTemplate>
</asp:UpdatePanel>
and here is the background code:
try
{
data_table = new DataTable();
string sql_statement = "SQL" + DateTime.Now.ToString("ddMMMyyyyHHmmss");
sql_connection = new MySqlConnection((string)Session["connection_string"]);
sql_connection.Open();
sql_command = new MySqlCommand("PREPARE " + sql_statement + " FROM '" + txtQuery.Text + "'; EXECUTE " + sql_statement + "; DROP PREPARE " + sql_statement + ";", sql_connection);
sql_command.CommandType = CommandType.Text;
sql_adapter = new MySqlDataAdapter(sql_command);
sql_adapter.Fill(data_table);
gridQuery.DataSource = data_table;
gridQuery.DataBind();
}
catch (MySqlException exp)
{
lblErrorDetails.Text = exp.Message;
panelError.Visible = true;
return;
}
finally
{
if (sql_reader != null) sql_reader.Close();
if (sql_connection != null)
{
if (sql_connection.State == ConnectionState.Open)
sql_connection.Close();
}
}
|
|
|
|
|
Hi,
How can I determine what's the current server name in mysql?
|
|
|
|
|
Does MySQL have a server?
|
|
|
|
|
Hi,
How can I determine the default character set and collation for the mysql server?
|
|
|
|
|
Use ServerProperty() Function.
See MSDN[^] For more details.
|
|
|
|
|
Hello
I'm trying to run some big delete statements and keep running into the following exception:
Error - The transaction log for database 'SomeDatabase' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases, Line: 16
I've already created a 20GB log file for it, still failing
dev
|
|
|
|
|
I know this is a long shot, however I would look for an explanation in the log_reuse_wait_desc column in sys.databases, more particularly at line 16.
And if that does not help, at least tell us what you see there.
|
|
|
|
|
Are you using transactions ?
If so, maybe you need to change your algorithm so that you are not deleting so many rows at one time.
Something like:
select key from mytable into #Temp1
Loop
begin transactioin
delete some rows where select top 1000 from #Temp1
delete same rows from #Temp1
Commit
Until No more rows in #Temp1
Otherwise, if this is part of a one-time data cleanup, then you might want to
A) Get your users off the database, so that you can do system maintenace.
1) Take a full backup of the database
2) switch the recover mode of the database to "simple"
3) Perform your delete
4) Take another full backup
5) Put the database back into the recovery mode you had before
6) Allow your users back into the database
Just some ideas.
Good luck.
|
|
|
|
|
Devvy, look at David's answer, understand it and implement the idea, he has identified problem and told you the solution. Managing really large transactions can be a complete PITA.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
can somebody tell me the ways of passing values to stored proc from C++ or C# code.
vikas da
|
|
|
|
|
i am not sure if u really meant that..here i sent cek_no value to my stored proc. like that..
cmd.Parameters.AddWithValue("cek_no", System.Data.SqlDbType.NVarChar).Value=table.Row[i][0].ToString();
vemedya.com
|
|
|
|
|
Thanks for the answer i ment in my question was suppose u need to pass 5 parameters .. so we can wither pass them separately or is there any other way to pass them when i can pass as single argument.
vikas da
|
|
|
|
|
Then you repeat the above 5 times.
|
|
|
|
|
Create a command object (sql client)
add an array of sql parameters
add a valid connection string to the command object
execute the command (executescalar)
Will you please do some research, a simple Google query will do - this question has been answered 1000s of times before and there are many many examples on the net showing you how to do this.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
No, it seems that he wants to pass a class or struct or something.
|
|
|
|
|
PIEBALDconsult wrote: pass a class or struct
How did you get that from the OP.
The the answer would still be the same with an explanation that you cannot pass objects unless they are as xml data type
Never underestimate the power of human stupidity
RAH
|
|
|
|