Jul 30 2010

Comment by Seth Spearman on Can you define a NULL on a column definition in the Create Table statement in a Firebird DB?

That was it. The Null is not allowed. By the way...I also learned that you can't name a field Active without delimiting with quotes. Seth
Jul 29 2010

Can you define a NULL on a column definition in the Create Table statement in a Firebird DB?

I am using SQL Manager Lite to try to run a DDL Create Table script. I am new to Firebird and I don't know why it isn't working. The following script...

create table Contacts (
    ID                      integer            not null,
    FirstName               varchar(64)        not null,
    LastName                varchar(64)        not null,
    MiddleInitial           varchar(1)             null
);

Is causing a parsing error (UNIDENTIFIED TOKEN) on the null constraint for the MiddleInitial column.

Here is the exact error returned by Sql Lite...

Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 5, column 52.
Null.

Is the NULL constraint not allowed in Create Table DDL for firebird?

Jul 29 2010

Can you define a NULL on a column definition in the Create Table statement in a Firebird DB?

I am using SQL Manager Lite to try to run a DDL Create Table script. I am new to Firebird and I don't know why it isn't working. The following script...

create table Contacts (
    ID                      integer            not null,
    FirstName               varchar(64)        not null,
    LastName                varchar(64)        not null,
    MiddleInitial           varchar(1)             null
);

Is causing a parsing error (UNIDENTIFIED TOKEN) on the null constraint for the MiddleInitial column.

Here is the exact error returned by Sql Lite...

Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 5, column 52.
Null.

Is the NULL constraint not allowed in Create Table DDL for firebird?

Jul 27 2010

Great SQL Server tip on easy way to flatten records from SQL into a delimited string

I found this tip today.  It flattens records from a select statement without using a loop.  Who’d a thunk it.

http://ryanfarley.com/blog/archive/2005/02/17/1712.aspx

–NORTHWIND DATABASE

— YOU WOULD PUT THIS CODE INTO A FUNCTION.  PASS THE ID OF THE PARENT TABLE.

————————————-

declare @prodlist varchar(1000)
set @prodlist = ”

select
@prodlist = @prodlist + p.productname + ‘, ‘

from
orders o

inner join [order details] o2
on o.orderid = o2.orderid

inner join products p
on o2.productid = p.productid

where
o.orderid = @id

–trim off extra comma at end
if @prodlist <> ” set @prodlist = left(@prodlist, len(@prodlist) – 2)

return @prodlist

Seth

Jul 22 2010

How do you setup the convert extension in Mercurial in windows?

I have just installed mercurial (command line only...this is not TortoiseHG) onto a Windows SErver 2003 machine and the documentation mentions a convert command that will allow me convert an svn repo to hg.

But when I try to run hg convert the command is not recognized. I googled it and it says that I need to install the "convert extension" using the hgrc file.

I HAVE google this and I cannot find anything that will tell me EXACTLY how to get it working. I don't know what file and filename is needed and which directory path should it be in.

I found this page which talks generically about configuration and this page which talks about the convert extension but neither of them puts it together with enough specificity.

SUMMARY- exactly how do I setup hg to support the convert extension on Windows Server 2003.

Thanks.

Jul 22 2010

How do you setup the convert extension in Mercurial in windows?

I have just installed mercurial (command line only...this is not TortoiseHG) onto a Windows SErver 2003 machine and the documentation mentions a convert command that will allow me convert an svn repo to hg.

But when I try to run hg convert the command is not recognized. I googled it and it says that I need to install the "convert extension" using the hgrc file.

I HAVE google this and I cannot find anything that will tell me EXACTLY how to get it working. I don't know what file and filename is needed and which directory path should it be in.

I found this page which talks generically about configuration and this page which talks about the convert extension but neither of them puts it together with enough specificity.

SUMMARY- exactly how do I setup hg to support the convert extension on Windows Server 2003.

Thanks.

Jul 22 2010

How do you setup the convert extension in Mercurial in windows?

Hello,

I have just installed mercurial (command line only...this is not TortoiseHG) onto a Windows SErver 2003 machine and the documentation mentions a convert command that will allow me convert an svn repo to hg.

But when I try to run hg convert the command is not recognized. I googled it and it says that I need to install the "convert extension" using the hgrc file.

I HAVE google this and I cannot find anything that will tell me EXACTLY how to get it working. I don't know what file and filename is needed and which directory path should it be in.

I found this page which talks generically about configuration and this page which talks about the convert extension but neither of them puts it together with enough specificity.

SUMMARY- exactly how do I setup hg to support the convert extension on Windows Server 2003.

Thanks.

Jul 19 2010

Comment by Seth Spearman on Is the Mercurial .hgignore my only option for handling hundreds of temp files generated when compiling?

JNeefer, I am just curious? Why did you have to put the source of the open source project into your project? Could you just compile the binaries and put them into your source? Just trying to learn something new here. Seth
Jul 16 2010

If you are moving a Windows 7 physical machine to a VirtualBox VM don’t forget to …

Just spent all day resolving this one but in the end it was surprisingly simple.

I think after all that I did…I COULD have done just these two steps…

I was getting BSOD when attempting to boot.  The STOP code was 0x0000007b.  This stop code means inaccessible boot device.

I should have done the following.  http://support.microsoft.com/kb/314082 .  Before making an image of your Windows 7 that you want to virtualize follow the steps in the knowledge base article.  On my machine the Atapi.sys, Intelide.sys, Pciide.sys, and Pciidex.sys drivers were already in the %SystemRoot%\System32\Drivers folder.  So you might be able to skip that step.  (The main step, merge the REG file into windows, is required).  For more on this see this virtualbox page.  http://www.virtualbox.org/wiki/Migrate_Windows

(Incidentally, having Search Everything sure helps with finding files on a Windows system.  Get it from http://www.voidtools.com/.  It indexes EVERY SINGLE FILE on your system so you can search by filename for any file.  It does NOT index the content of those files…only file names.)

Next when creating the new virtualbox I should have added a SATA disk controller and put my c-drive under it rather than the IDE controller that VirtualBox created by default.  Duh!

That fixed me up.

Seth

Jul 16 2010

Mercurial Workflow and Tutorial

I just read Joel Spolsky’s outstanding introductory tutorial to Mercurial. Mercurial is a distributed Version Control System.  You can read it at http://hginit.com.

Here is my glossary and workflow description from the tutorial for mercurial.

WORKFLOW

  1. If you haven’t done so in a while, get the latest version that everyone else is working off of:
    • hg pull
    • hg up
  2. Make some changes
  3. Commit them (locally)
  4. Repeat steps 2-3 until you’ve got some nice code that you’re willing to inflict on everyone else
  5. When you’re ready to share:
    • hg pull to get everyone else’s changes (if there are any)
    • hg merge to merge them into yours
    • test! to make sure the merge didn’t screw anything up
    • hg commit (the merge)
    • hg push

GLOSSARY

hg help

hg init                                    Create a repo.  Be in the directory you want to source.

hg add                                  adds files in directory to repo

hg commit (com)              Commit changes to local repo   -m include a message in quotes

hg log                                    see changes since last commit.  –P shows changes that just arrived.

hg revert                             revert changes to last changeset   –all (revert all files)

hg status                              list files that have change

hg diff   <file>                    show changes in a file

hg cat                                    print file to screen           -r N <file> (where N  is a changeset #) print that version.

hg update (up)  -r N          N is changeset #.  Changes your working set to that revision.  With no number goes to latest.

hg serve                                 Share the repository in the built in web server (port 8000 default)

hg clone                                 clone the repository    hg clone <url/path-to-repo> <new folder name>

hg push                                  Pushes changes from local repo to central repo

hg outgoing (out)               Lists changes that are waiting to be sent to central repo

hg incoming (in)                  Lists changes that are waiting to be sent from central repo to local repo

hg merge                               combines changeset into new tip.  Then use commit to commit merge to repo.  If merge fails you can revert it.  On success you can commit it.

hg parent                              tells you what changeset your are working in.   Pull does not change your changeset so a pull is always safe.

hg rollback                            Undoes one commit but only if it hasn’t been pushed. (Revert changes to the last commit whereas rollback reverts the last commit.)

hg paths                                 default = shows the path to the default repository that a push will use.

Hg backout –r N –merge              undoes a particular  changeset from the working directory

hg tag <name>                    Give current changeset a name.  Then you can use it for N.

NOTES

If you see when doing a push…

abort: push creates new remote heads!

(did you forget to merge? use push -f to force)
…then you need to do a Pull then do a Push