|
-
Verifying Basic SQL Functionality
Date: 10/05/06
(SQL Server) Keywords: database, sql
I've been asked by my manager to come up with a script to run before and after an upgrade of SQL server to verify that basic statements within SQL work before and after an upgrade. Here's what I came up with. Anyone else ever do something like this?
/* SQL Standard Health Check DBA : Amy Boyd Date: 10/5/2006
This is a script that can be run prior to and after the upgrade of SQL server components to verify basic functionality.
*/ set nocount on select 'Server Name: ' + @@servername + ' at version: ' + @@version
use admin -- or any other test database you might have select 'Testing a select of a few sysobjects from admin db...' select * from sysobjects where id < 5 if @@error = 0 begin select 'Select of sysobjects successful' select '' end
select 'Testing table creation' create table test_upgrade ( message varchar(100)) if @@error = 0 begin select 'Table creation successful' select '' end
select 'Testing Insert into Table' insert into test_upgrade values ('Table Insert Works') if @@error = 0 begin select 'Insert successful' select '' end
select 'Testing Update of Table' update test_upgrade set message ='Table Update Works' if @@error = 0 begin select 'Update of table Successful' select '' end
select 'Testing Delete from Table' delete from test_upgrade if @@error = 0 begin select 'Delete from table successful' select '' end
select 'Testing Drop table command' drop table test_upgrade if @@error = 0 begin select 'Drop of table successful' select '' end
use msdb select 'Testing a select of a few sysobjects from msdb db...' select * from sysobjects where id < 5 if @@error = 0 begin select 'Select of sysobjects successful' select '' end
use master select 'Testing a select of a few sysobjects from master db...' select * from sysobjects where id < 5 if @@error = 0 begin select 'Select of sysobjects successful' select '' end
select 'Retreiving list of databases from ' + @@servername select * from sysdatabases select ''
if @@error = 0 begin select 'Getting disk space stats for ' + @@servername exec xp_fixeddrives select '' end
select 'Basic SQL Operations are working. Do not forget to test start/stop of SQL Server and Agent.' select ''
if @@error > 0 select 'There was an error executing the health check please verify output for resolution.'
Source: http://community.livejournal.com/sqlserver/52733.html
-
Some help on approaching CMS systems
Date: 10/05/06
(PHP Development) Keywords: cms, php, mysql, css, html, sql, web
I am looking for some opinions on how to best approach creating a web site with a CMS system.
I was originally thinking of implementing various bits of code freely available online and then merging them to play nicely together as one for a client of mine but came across some rather unique-looking packages on the web. One of these packages is Typo3, although I have some concerns about it.
Typo3 seems to be amazing in the sense that it literally "has it all"--guestbooks, galleries, tracking, comments, CMS, easy editors, etc.--but this is also what worries me. As a web designer and developer, I adhere to strict XHTML/CSS standards and to the separation of content and representation for web design. My concern is that as a huge monolithic package, it looks terribly susceptable to some terrible, broken HTML and design-procedures that would be near impossible to fix.
I have also come across CMS Made Simple but haven't had much of an opportunity to delve into it. It is very likely to suffer from these same things, although I do not think, from memory, that it was as full blown a project.
Now keep in mind, I am a much stronger designer than developer but I am quite able to dive into code and hack and adjust things as needed as I have experience in PHP, MySQL, and the like. Does anyone have any experience with these packages or others like them? Would it make more sense for me to develop an entire system from scratch or by piecing smaller works together?
Any recommendations or opinions would be very much appreciated.
PS. If this was a due-by-next-week thing, it would be a no-brainer. The client wants this done ASAP, but not necessarily so fast as to comprimise quality.
Source: http://community.livejournal.com/php_dev/72753.html
-
ээнкапсуляция, мать её так :)
Date: 10/06/06
(Code WTF) Keywords: mysql, sql
class banner_class extends mysql_class
{
function test()
{
.... ....
}
}
$result = new banner_class;
$template = $result->test();
готовый код, в функции
конструкции вида
if ($_POST['foo'] == 'bar') {
...
} ...
{
}
Source: http://community.livejournal.com/code_wtf/54113.html
-
On-the-fly PDFs.
Date: 10/06/06
(PHP Community) Keywords: php, mysql, sql, web, google
My employer wants to start generating PDFs from our PHP management system. I'm still pretty new to really 'doing things' with PHP and the PDF documentation I looked at on the online manual lacks clarification on almost every command for it.
I'm wondering if someone has an idea of where I can read something of substance on the subject. My google results turned up a few web design tutorials - but they are based on depreciated code.
Specifically I need to learn how to open a PDF file as a template only with added data from form/mysql information.
Source: http://community.livejournal.com/php/500859.html
-
re-sort query results?
Date: 10/10/06
(PHP Community) Keywords: mysql, sql
My brain is fried. I have a query that gets the last 5 items from a mysql table by ordering them in descending order and limiting them to 5 (ORDER BY ID DESC LIMIT = 5). But, I then need to display the results in ASC order.
I am using some legacy code I am not entirely familiar with (the "$this->" operator), and I feel a little lost. Any ideas?
Current code: $this->DBQuery("SELECT * FROM ".$this->table[3]." WHERE adate<='".$adate."' AND ".$sectionID." AND ".$priority." AND ".$authorID." AND status=1 ORDER BY ID DESC LIMIT ".$articlenumber);
Source: http://community.livejournal.com/php/501510.html
-
mysql_connect(...) - IP Vs. Socket
Date: 10/11/06
(PHP Community) Keywords: php, mysql, sql
I haven't found much documentation on using a mysql socket 'localhost:/path/To/mysql.socket' versus just doing 'localhost' or 'myIP' when connecting to mysql using the php client library. Anyone know of any difference? I assume that sockets are more secure/faster because it doesn't have to go through the net stack just to communicate with a process that is on the same machine. But was curious if anyone knew.
Source: http://community.livejournal.com/php/501894.html
-
Visual Basic 6 question
Date: 10/12/06
(IT Professionals) Keywords: software, sql, web
Hi all.
Im new to the community. Quick intro is needed I guess:
Im a 24 year old student from the North East of England, currently studying computing for business at Northumbria University.
Im now on my 3rd year and I have been on my work placement for about 3 months. Its great. Three lads sitting in a room, supporting an entire companies I.T resources.
My job is also to maintain and improve upon a piece of inhouse software called TrackIT. It pretty much keeps track of all telesales activity within the entire company. They sell training to other companies such as water and eletricity.
Anyhoo!
TrackIT, is wrote in that lovely language visual basic 6. Now I know nothing about visual basic 6, but im done a pretty good job so far. My education was within Visual Basic.NET, but that education left alot to be desired.
So my issue is this:
I know this is probably a really simple question and YES I have looked on every website I can find, and used every text book I can get my hands on.
Im astounded I cant find this anywhere.
I very simple need to take the value which has been selected inside a datacombobox, and send it as a string to an SQL statement. The result of which would be a filtered datagrid.
I did a test with a message Box saying, "MsgBox (dcFilterCompanyName.Item.Text)", because that code wasnt working.
Am I being completely stupid thinking that piece of code would return the value selected in the datacombo?
If I am, then can someone please tell me what code to use to retreive the value selected?
Source: http://community.livejournal.com/itprofessionals/44969.html
-
Combobox Selected Index Changed event
Date: 10/13/06
(C Sharp) Keywords: database, sql
Yes, I'm beating my same dead horse, of course. Now, I'm really confused. But at least my confusion is limited to a single control this time. C# 2005 standard, Windows XP Pro, tied to a SQL Server 2000 database.
I have a control on a winform called cboName. Is is bound to a bindingsource called bsHosp, which goes back to a table called Hospitals. The bindingsource has a sort on it by name ascending, so everything in this box is in alphabetical order. Where I'm running into severe confusion is in the SelectedIndexChanged event (which has been the cause of all my woes over the past two weeks). The bindings on the combobox: SelectedItem: bsHosp.Name SelectedValue: bsHosp.ProvNo Tag: (none) Text: bsHosp.Name
(ProvNo and Prov_ID
In order to test the screwy databinding (check a few messages back in this community for a description), I put in a messagebox to check that the filter and sort on the other bindingsource were actually being changed. Here's the code for the SIC event:
private void cboName_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
bsRate.Filter = "prov_id = " + txtProvNo.Text;
bsRate.Sort = "mexp desc";
bsRate.ResetBindings(false);
MessageBox.Show("Filter = " + bsRate.Filter.ToString() + " Sort = " + bsRate.Sort.ToString());
}
catch (Exception ex)
{
}
finally
{
}
}
(It's in the try block to prevent the program from throwing an exception when the form is closed.)
Now, to show you what it's doing, I actually have to show you a piece of the table itself. Like I said, this is right weird.
68267 Adams County Hospital 62578 Bellevue Hospital 4628 Belmont Pines Hospital
Adams, being the first one on the list, is what pops in by default. Each of these contains one entry in the table.
When I try to switch to Bellevue Hospital, this is what happens:
1. Messagebox shows prov_id 68267, combobox shows Adams County Hospital. 2. Messagebox shows prov_id 68267, combobox shows Bellevue Hospital. 3. Messagebox shows prov_id 68267, combobox is blank. 4. Messagebox shows prov_id 62578, combobox shows Belmont Pines Hospital. 5. Messagebox shows prov_id 62578, combobox is blank. 6. Messagebox shows prov_id 4628, combobox shows Belmont Pines Hospital. 7. When I check the dropdown list in the combobox again, Adams County Hospital has disappeared and Bellevue Hospital is in the dropdown list twice. There is no change to the underlying table.
I assume this behavior is not normal, especially since I'm not even getting the name I'm selecting in the textbox. Has anyone seen anything like this, and can you tell me why it's happening? And, preferably, how to fix it?
* * *
Variations:
1. When I put the MessageBox command in the finally clause instead of the try clause, I get the same result. 2. When I take out the try/catch clause altogether, again, the same thing happens. 3. It makes no difference whether the ResetBindings command is commented out or not.
Thanks.
Source: http://community.livejournal.com/csharp/76871.html
-
Old-school databinding and DataMembers
Date: 10/19/06
(C Sharp) Keywords: database, sql, web, microsoft
Yes, I'm back.
private string ConnectionString;
private DataViewManager dsView;
private DataViewManager dsViewHospitals;
private DataSet ds;
public TestHospitalFormGrid()
{
InitializeComponent();
ConnectionString = "data source=edison;uid=sa;password=nothing;database=hospratestest";
SqlConnection cn = new SqlConnection(ConnectionString);
//Create the DataSet
ds = new DataSet("HospRates");
//Fill the dataset with hospitals
SqlDataAdapter da1 = new SqlDataAdapter("select * from hospitals", cn);
da1.TableMappings.Add("Table", "Hospitals");
da1.Fill(ds, "Hospitals");
//Fill the dataset with rates
SqlDataAdapter da2 = new SqlDataAdapter("select * from CombinedRateData", cn);
da2.TableMappings.Add("Table", "Rates");
da2.Fill(ds, "Rates");
//tables father back will go here later
//Establish relatinship between hospitals and rates
DataRelation relHospRates;
DataColumn MasterColumn;
DataColumn DetailColumn;
MasterColumn = ds.Tables["Hospitals"].Columns["ID"];
DetailColumn = ds.Tables["Rates"].Columns["prov_id"];
relHospRates = new DataRelation("HospRatesRelation", MasterColumn, DetailColumn);
ds.Relations.Add(relHospRates);
dsView = ds.DefaultViewManager;
dsViewHospitals = ???;
dgDetail.DataSource = dsView;
dgDetail.DataMember = "Rates.HospRatesRelation";
//dgDetail.DataSource = "Rates.HospRatesRelation";
cboName.DataSource = dsView;
cboName.DisplayMember = "Hospitals.Name";
cboName.ValueMember = "Hospitals.ID";
}
}
This code generates an error. After two hours of looking around the web, I finally got pointed to this KB article, which tells me my problem stems from the fact that my DataMember has a period in it, and that this bug is considered a "feature" by Microsoft. As you can see, I have tried setting the datasource directly to the relation; this results in the form loading and the datagrid remaining empty no matter what I do.
I need to find a way to set the datasource of the datagrid to the relation in question. It seems to me that the easiest way to do this will be to set the view dsViewHospitals to only show the relation in the dataset, but I'm not finding any code samples for how to set view to anything other than DefaultViewManager programmatically at Microsoft. How would I go about doing such a thing? Thanks.
Source: http://community.livejournal.com/csharp/77639.html
-
Query Analyzer Vs. SRS... different results
Date: 10/19/06
(C Sharp) Keywords: database, sql
So, I'm posting here in hopes that someone has encountered something like this before and knows a way to fix it.
this is a larger issue, but the crux of it is simply this query (yes it calles a sql server stored proc):
spRPT_TKT_ThreeDayCountReport null,null,null,null,null,null,'9/16/2006','10/15/2006',null,null,null,null,null,null,null,null,null
When executed from query analyzer (paste in, hit f5) connected to the production database I get one set of results. When executed as a dataset (command type: text) in Sql Reporting Services, I get a different set of results.
The row counts and MOST of the associated data are exactly the same, the problem lies in SOME of the individual items are 0 (not null, just 0), in all cases these are sum(isnull(-variable-),0) items in the Sproc.
I am at a loss for why the results to this query are different from one application to the other. (and they are 100% reproducable).
any ideas?
Source: http://community.livejournal.com/csharp/78075.html
-
a little green...
Date: 10/20/06
(SQL Server) Keywords: sql, web, google
Hello I'm relatively new to SQL.
Do any of you know of some good websites regarding SQL queries? I've done a search on google but I haven't been too impressed with what I've seen so far.
Thank you for your help!
Source: http://community.livejournal.com/sqlserver/52793.html
-
SQL Server 2000 -> 2005 Upgrade Costs
Date: 10/23/06
(IT Professionals) Keywords: database, sql, microsoft
x-posted all over
My division is looking at upgrading our SQL Servers from 2000 to 2005 within the next six months. The other day, my boss asked me if I could do some online research to try and find an "Upgrade Cost Estimate calculator" of some sort. From his business perspective, for any given number of factors such as # of database servers, database average size, # of objects, etc., could be punched into some kind of magical formula to output an estimated manhour cost. He figures that someone HAS to have done this sort of analysis already, and is hoping that I can find it.
Has anyone out there heard of or seen such a thing, whether it be an online estimator, a PowerPoint presentation, or even a speech from a Microsoft rep? Thanks in advance!
Source: http://community.livejournal.com/itprofessionals/45680.html
-
SQL Server 2000 -> 2005 Upgrade Costs
Date: 10/23/06
(SQL Server) Keywords: database, sql, microsoft
x-posted all over
My division is looking at upgrading our SQL Servers from 2000 to 2005 within the next six months. The other day, my boss asked me if I could do some online research to try and find an "Upgrade Cost Estimate calculator" of some sort. From his business perspective, for any given number of factors such as # of database servers, database average size, # of objects, etc., could be punched into some kind of magical formula to output an estimated manhour cost. He figures that someone HAS to have done this sort of analysis already, and is hoping that I can find it.
Has anyone out there heard of or seen such a thing, whether it be an online estimator, a PowerPoint presentation, or even a speech from a Microsoft rep? Thanks in advance!
Source: http://community.livejournal.com/sqlserver/53179.html
-
How To Use Vanilla Forum On MySQL Database Without Password Set
Date: 10/23/06
(Java Web) Keywords: mysql, database, sql
First of all I want to make it clear that having a MySQL database without a password set (on your root account) is a very very bad idea. However I wanted to set it up on my home machine which has XAMPP installed. And XAMPP by default creates a root account for MySQL without any [...]
Source: http://blog.taragana.com/index.php/archive/how-to-use-vanilla-forum-on-mysql-database-without-password-set/
-
Auto delete records
Date: 10/23/06
(MySQL Communtiy) Keywords: mysql, sql
I have a site where postings expire after 30 days. Whats the best way to automatically delete them from MySQL?
Source: http://community.livejournal.com/mysql/104915.html
-
two questions
Date: 10/24/06
(SQL Server) Keywords: database, sql
Hi all, forgive me if these have already been asked a zillion times...
1. what is the SQL query for determining the primary key of a table? meaning, i know there is SOMEthing like this that I can do:
select primary_keys from information_schema where table_name = 'myTable'
...but I don't remember the right syntax. anyone?
2. i'm building my database on a destkop machine. later, i want to do an export that will INCLUDE a very complicated database diagram that i've drawn in Enterprise Manager. is that possible? is there a way to save out JUST the diagram in some format that can later be imported into antoher SQL server machine elsewhere?
thanks for your time.
Source: http://community.livejournal.com/sqlserver/53307.html
-
Completely Lost
Date: 10/24/06
(MySQL Communtiy) Keywords: mysql, database, sql
Hello. I am so glad I found this community. I am very new to MySQL & completely lost. I'm using it for a Database Fundamentals course that I'm taking. The instructor isn't teaching us the material...she's expecting us to learn from the textbooks. I'm finding this to be a subject that's hard to learn from books alone. An example of what I'm having a problem with:
DROP TABLE IF EXISTS `book`; CREATE TABLE `book` ( `BOOK_CODE` char(4) NOT NULL default '', `TITLE` char(40) default NULL, `PUBLISHER_CODE` char(3) default NULL, `TYPE` char(3) default NULL, `PRICE` decimal(4,2) default NULL, `PAPERBACK` char(1) default NULL, PRIMARY KEY (`BOOK_CODE`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- -- Dumping data for table `henry`.`book` --
/*!40000 ALTER TABLE `book` DISABLE KEYS */; INSERT INTO `book` (`BOOK_CODE`,`TITLE`,`PUBLISHER_CODE`,`TYPE`,`PRICE`,`PAPERBACK`) VALUES ('0180','A Deepness in the Sky','TB','SFI','7.19','Y'), ('0189','Magic Terror','FA','HOR','7.99','Y'), ('0200','The Stranger','VB','FIC','8.00','Y'), ('0280','Rumpole for the Defence','PE','MYS','7.19','Y'), ('0378','Venice','SS','ART','24.50','N'), ('0389','Concepts of Database Management','CT','CMP','43.99','Y'), ('079X','Second Wind','PU','MYS','24.95','N'), ('0808','The Edge','JP','MYS','6.99','Y'), ('1351','Dreamcatcher: A Novel','SC','HOR','19.60','N'), ('1382','Treasure Chests','TA','ART','24.46','N'), ('138X','Beloved','PL','FIC','12.95','Y'), ('1456','Truman','SS','HIS','29.90','Y'), ('2226','Harry Potter and the Prisoner of Azkaban','ST','SFI','13.96','N'), ('2281','Van Gogh and Gauguin','WP','ART','21.00','N'), ('2766','Of Mice and Men','PE','FIC','6.95','Y'), ('2908','Electric Light','FS','POE','14.00','N'), ('3350','Group: Six People in Search of a Life','BP','PSY','10.40','Y'), ('3743','Nine Stories','LB','FIC','5.99','Y'); INSERT INTO `book` (`BOOK_CODE`,`TITLE`,`PUBLISHER_CODE`,`TYPE`,`PRICE`,`PAPERBACK`) VALUES ('3906','The Soul of a New Machine','BY','SCI','11.16','Y'), ('5163','Travels with Charley','PE','TRA','7.95','Y'), ('5790','Catch-22','SC','FIC','12.00','Y'), ('6128','Jazz','PL','FIC','12.95','Y'), ('6328','Band of Brothers','TO','HIS','9.60','Y'), ('669X','A Guide to SQL','CT','CMP','37.95','Y'), ('6908','Franny and Zooey','LB','FIC','5.99','Y'), ('7405','East of Eden','PE','FIC','12.95','Y'), ('7443','Harry Potter and the Goblet of Fire','ST','SFI','18.16','N'), ('7559','The Fall','VB','FIC','8.00','Y'), ('8092','Godel, Escher, Bach','BA','PHI','14.00','Y'), ('8720','When Rabbit Howls','JP','PSY','6.29','Y'), ('9611','Black House','RH','HOR','18.81','N'), ('9627','Song of Solomon','PL','FIC','14.00','Y'), ('9701','The Grapes of Wrath','PE','FIC','13.00','Y'), ('9882','Slay Ride','JP','MYS','6.99','Y'), ('9883','The Catcher in the Rye','LB','FIC','5.99','Y'), ('9931','To Kill a Mockingbird','HC','FIC','18.00','N'); /*!40000 ALTER TABLE `book` ENABLE KEYS */;
How do I put that in proper format in a database, so I can run & install it in a MySQL database? Or can I run it as is? Or are there any really simple resources that you could suggest, that might also offer some assistance?
Thank you so much for the help!
Source: http://community.livejournal.com/mysql/105012.html
-
Data Warehouse / Data Mart design guidelines
Date: 10/27/06
(SQL Server) Keywords: sql
I have been working on a SQL Server 2000 project to generate/transform data so that we can upload it from our data warehouse [corporate-level] into another data warehouse [enterprise-level]. One of the big requirements for this project is that it's reliable, we are notified of errors, and that we can measure our processes. Does anybody know of any good online resources/articles that specifically discuss:
Measuring/monitoring SQL Server jobs?
Tips for writing robust stored procedures?
Other thoughts/ideas/discussion are welcome as well.
Source: http://community.livejournal.com/sqlserver/53745.html
-
Optimization baseline.
Date: 11/01/06
(MySQL Communtiy) Keywords: sql
Trying to optimize a DB server but it's got some difficulties. So far the only benchmark suite I've run is the sql-bench but I don't have anything to compare it to except its self. So far, with minimal optimization, it can do 30K of key based updates in 31 seconds or just a little bit over 1 second a update. I'd like to bring that time down and with the hardware provided it should be possible. Any suggestions or links to other benchmark results?
Source: http://community.livejournal.com/mysql/105557.html
-
Need PHP/MySql/Joomla coder
Date: 11/03/06
(Computer Geeks) Keywords: php, mysql, html, sql, web
I'm working on a Joomla web site project that will be getting national attention over the next two years (it is election-related, with a "test run" for the 2007 election, but the real fun will happen in 2008). I need to find a coder who can help create a Joomla component and module. We have designers for the layout, this is just the backend MySql coding and the front-end component/module code as well as HTML form code for interaction.
As such, I need someone who can hit the ground running with MySql, PHP and understands or can quickly come up to speed with the coding model of Joomla.
If this is you and you'd be interested in working on a high-profile project that will get much national attention, a load of traffic, likely become a reasonably well-known meme, and also actually make some small difference in the screwed-up political process we have here in the United States, please let me know.
Source: http://community.livejournal.com/computergeeks/996690.html
|