Tuesday, November 25, 2008
As a solution for this what we can we do is, we can call a function as this way
There for because of the none existence of this function this will be raise an error.
So it is very logical..:-)
So procedure will be work very fine.....Great...
DROP PROCEDURE IF EXISTS `dbname`.`procedureName` $$
CREATE DEFINER=`root`@`%` PROCEDURE `edbname`.`procedureName`(
((Id = pId)
Name = pName,
(Id = pId);
/*There is no RaiseError metho in MySql.
Because of that reason here call nonexistent method which is 'RaiseError()'.There for this will produce an error*/
Friday, November 21, 2008
When buying things like clothes, set a rule for yourself that you can only buy something new, to replace something you already have. For example, from a practical point of view, let’s say you need to have 15 business shirts. Set a ‘budget’ of having 15 shirts, and then when you want to buy one, first throw away (or give to charity) the worst of the other. Can’t make a choice which one to throw out? Guess what: you won’t need a new shirt.
Even if you mannually typethe connection string and click on 'Test' button it will say Mysql.data.dll not exist.
This is because of compatibility issue...
To sortout this.....:-)
So i had t installed earlier version. It also did not work. So copy 'MySql.Data.dll'
to bin folder of codesmith (C:\Program Files\CodeSmith\v5.0\bin). Mannaully type the connction string and test. Then it will works fine................................
Thursday, November 20, 2008
- Create a new table with the required columns,
- Copy the data from the old table into the new table
- Delete the old table
- Then rename the new table.
Create Table A
(col1 varchar(50) null,
col2 varchar(50) null)
--Add new column col3
Create Table B
col1 varchar(50) null,
col3 varchar(50) null, -- NEW COLUMN IN MIDDLE (NULLABLE)
col2 varchar(50) null
if exists(select * from A)
exec('insert into B (col1, col2)
select col1, col2 from A with (holdlock tablockx)')
drop table A
execute sp_rename 'B', 'A', 'object'
Wednesday, November 19, 2008
This is new topic for me and I started to work on that few days ago. It is interesting to play and I learn lot during the days. :-) .Learning curve of the NHibernate is bit long and few resources are available. But using trial and error could be able to solve lot of problems.
What is ?
NHibernate is ORM solution and is intended for transparent binding .NET classes to database tables.Commonly we have mismatch beween the relational database and our objects. The aim of the NHibernate is reducing time efforts to switch application to another database provider .Basically it provides low overhead .
“NHibernate increases your performance as a developer”.