What are some of the methods/techniques experienced SQL developers use to determine if a particular SQL query will scale well as load increases, rows in associated tables increase etc.
Hi,I am Working on a project (C#) in the university and they said that we can't use a DBMS like SQL Server so we decide to use Linq and XML...we learned some basics in Linq to Xml But really we don't know how we can create tables and fields and work with them in Xml.any suggestions ?
I am using mysql 5.1 and mysql gems version is 2.73
This is giving the following error message when I try to run it from a limited account in my XP. If try it using the admin account, it works fine. I think this is wierd because it cannot be the problem of mysql gem.
(in F:/Temp/wassup)
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install
the mysql gem and try again: gem install mysql.
rake aborted!
5: Access is denied. - C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/mysql-2.7.
3-x86-mswin32/ext/mysql.so
(See full trace by running task with --trace)
I need to work from the limited account. Can anyone let me know why is this happening?
I want to make a table that displays on a webpage, but one requirement is to make it easy to copy and paste into a spreadsheet. Normal HTML tables selection behavior is obviously different from how a spreadsheet like Excel selects -- when you select multiple rows it wraps around instead of selecting a rectangular area. Is there any way to make HTML table behave like a spreadsheet in this regard, or is the only way to resort to a Flash table or something similar?
Howdy, am trying to copy a file from IE cache to somewhere else. This works on w7, but not Vista Ultimate.
In short:
copy-item $f -Destination "$targetDir" -force
(I also tried $f.fullname)
The full script:
$targetDir = "C:\temp"
$ieCache=(get-itemproperty "hkcu:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders").cache
$minSize = 5mb
Write-Host "minSize:" $minSize
Add-Content -Encoding Unicode -Path $targetDir"\log.txt" -Value (get-Date)
Set-Location $ieCache
#\Low\Content.IE5 for protected mode
#\content.ie5 for unprotected
$a = Get-Location
foreach ($f in
(get-childitem -Recurse -Force -Exclude *.dat, *.tmp | where {$_.length -gt $minSize})
)
{
Write-Host (get-Date) $f.Name $f.length
Add-Content -Encoding Unicode -Path $targetDir"\log.txt" -Value $f.name, $f.length
copy-item $f -Destination "$targetDir" -force
}
End of wisdom. Please help!
I am currently html encoding all user entered text before inserting/updating a db table record. The problem is that on any subsequent updates, the previously encoded string is reencoded. This endless loop is starting to eat up alot of column space in my tables. I am using parameterized queries for all sql statements but am wondering would it be safe to just let the .NET Framework handle this part without the HTML Encoding?
How to Dump only specific table from a database like if my Database has 10 table's and i want to dump only 3 tables of my choice...is it possible with "mysqldump" command...
I am interested in Examine for building searching in a standalone desktop app for searching db tables as well as office/.pdf files
This looks like an excellent scenario for Lucene/examine
However the doc there is minimal and while i have plenty of experience with SQL full text search, Lucene is a different beast altogether and hence looking for help/pointers on how/where to start
And yes, i did a google search but did not find any resources as the terms are fairly common ( lucene examine tutorial etc. )
OK so I've got 2 tables for this instance, Users{UserID, Name}, Company{CompanyID, UserID, Name, Payrate}
i also have 2 combo boxes, first one is for Users which Displays Name, and the Value is UserID
i need the second combobox to get the Names from the Company table, but only showing Companies that are relevant to the selected user. I cant work out how to get it to go...
Any ideas???
I have two tables: a WorkItem table, and a WorkItemNote table. How do I return a WorkItem and all of the WorkItemNotes that meet a certain criteria?
I think this should be simple, almost like a conditional "Include", right?
Today I run this
select 'exec sp_refreshview N''['+table_schema+'].['+table_name+']'''
from information_schema.tables
where table_type = 'view'
This generates a lot of: exec sp_refreshview N'[SCHEMA].[TABLE]'. I then copy the result to the query editor window and run all those execs.
How do I do this all at once?
I would like to have a stored procedure called something like dev.RefreshAllViews which I can execute to do this...
I know that title sounds crazy but here is my situation.
After a certain user event I need to update a couple tables that are "unrelated" to what the user is currently doing. Currently this takes a couple seconds to execute and causes the user a certain amount of frustration. Is there a way to perform my update in a second process or in a manner that doesn't "freeze" the UI of my app while it is processing?
Thanks
im trying to work through some questions and im not sure how to do the following
Q:Find the hard drive sizes that are equal among two or more PCs.
its q15 on this site
http://www.sql-ex.ru/learn_exercises.php#answer_ref
The database scheme consists of four tables:
Product(maker, model, type)
PC(code, model, speed, ram, hd, cd, price)
Laptop(code, model, speed, ram, hd, screen, price)
Printer(code, model, color, type, price)
any pointers would be appreciated.
Hello!
I have written a php script which generates an sql file containing all tables in my database.
What i want to do is execute this script daily or every n days. I have read about cron but i am actually using Windows. How can i automate the execution of the script on the server?
Thanks!
Hi,
I am loading data for tests in tables using xml and ndbunit.But,for a table having computed column,I am having problem.I get this error
The column "xyz" cannot be modified because it is either a computed column or is the result of a UNION operator.
I have modified the INSERT and UPDATE commands(removed the computed column) of sqladapter in xsd file,but still face the issue.
thanks
Hi I have the following code;
if( ! empty( $post['search-bar'] ) ) {
$search_data = preg_replace("#\s\s#is", '', preg_replace("#[^\w\d\s+]#is", '', $post['search-bar'] ) );
$data_array = explode( " ", $search_data );
$data_array = "'%" . implode( "%' OR '%", $data_array ) . "%'";
$query = "SELECT CONCAT( PROFILE_PROFFESION, FIRST_NAME, LAST_NAME, DISPLAY_NAME) AS 'STRING' FROM `" . ACCOUNT_TABLE . "` WHERE STRING LIKE ( " . $data_array . " ) AND BUSINESS_POST_CODE LIKE '" . substr(P_BUSINESS_POST_CODE, 0, 4) . "%'";
$q = mysql_query( $query, $CON ) or die( "_error_" . mysql_error() );
if( mysql_num_rows( $q ) != 0 ) {
die();
}
}
Problem is I want to use the temp col 'STRING' in the where clause but is returning 'unknown coloumn STRING Can any one point me in the right direction, regards Phil
I am trying to center a paragraph tag with some text in it within a div, but I can't seem to center it using margin: 0 auto without having to specify a fixed width for the paragraph. I don't want to specify a fixed width, because I will have dynamic text coming into the paragraph tag and it will always be a different width based on how much text it is.
Does anyone know how I can center the paragraph tag within the div without having to specify a fixed width for the paragraph or without using tables?
In the following model:
class header(models.Model):
title = models.CharField(max_length = 255)
created_by = models.CharField(max_length = 255)
def __unicode__(self):
return self.id()
class criteria(models.Model):
details = models.CharField(max_length = 255)
headerid = models.ForeignKey(header)
def __unicode__(self):
return self.id()
class options(models.Model):
opt_details = models.CharField(max_length = 255)
headerid = models.ForeignKey(header)
def __unicode__(self):
return self.id()
If there is a row in the database for table header as
Id=1, title=value-mart , createdby=CEO
How do i query criteria and options tables to get all the values related to header table
id=1
Also can some one please suggest a good link for queries examples,
Thanks..
I'm building a simple web application that is mainly going to be displaying small tables of data back to the user. The problem is I can't do design to save my life. I need a simple web 2.0 style template that is CSS/HTML compliant. I know about http://themeforest.net and http://www.oswd.org/. Just wondering if there are any other sites that have a good selection of templates suitable for web apps.
I have a database on the iPhone which as a view. When I update the dependent tables the view is not updated. It's only updated when I close and reopen the application. From there onwards things are okay: updates reflect immediately.
Is there something I need to do to force update of a VIEW?
During development of a PostgreSQL database, I made foreign keys in every table. The problem is that I forgot to select ON DELETE CASCADE option.
I need to set that options on all tables. It seems I can only drop and recreate every constraint manually.
Does anybody know any shortcuts?
I want to backup Development and restore it in test and vice-versa.
So when I do a backup of the db (in PGAdmin III), it backs it up. But
when I restore it, all primary key information is gone and no data is
in the tables.
Any help would be much appreciated. Thanks.
I have an appender setup like this
<appender name="Scheduler_Appender" type="log4net.Appender.RollingFileAppender">
<file value="c:\temp\ApplicationLog.txt"/>
<rollingStyle value="Date"/>
<datePattern value="yyyyMMdd"/>
<appendToFile value="true"/>
<staticLogFileName value="true"/>
<layout type="MinLayout">
<locationInfo value="true"/>
</layout>
</appender>
When the log file first gets created the file name is simply ApplicationLog.txt this is correct.
However when the logging rolls - the filename that gets generated is ApplicationLog.txt20100323 (for example), and not ApplicationLog20100323.txt
How can I change the configuration so files are rolled to [FileName][Date].[ext] rather than [FileName].[ext][Date]
Thanks
Hello Guys!
I've two MS SQL tables: Category, Question. Each Question is assigned to exactly one Category. One Category may have many subcategories.
Category
Id : bigint (PK)
Name : nvarchar(255)
AcceptQuestions : bit
IdParent : bigint (FK)
Question
Id : bigint (PK)
Title : nvarchar(255)
...
IdCategory : bigint (FK)
How do I recursively count all Questions for a given Category (including questions in subcategories). I've tried it already based on several tutorials but still can't figure it out :(
Hi,
Consider there are 3 different centers across the country,which have their different holidays schedule.Now i want to find that the current date is the business day or not(eliminate saturaday ,sunday and Holidays).
tell me,Which one is feasible? Can i store the details of the holiday with description in 3 separate tables for 3 different centers or in a 3 separate file? is it possible to read the file using PL\SQl?