Tuesday, December 2, 2014

localdb tips


SQL CLR is disabled by default, to enable:

using master

select * from sys.configurations where name = 'show advanced options'

sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'clr enabled', 1;
GO
RECONFIGURE;
GO

select * from sys.configurations where name = 'show advanced options'

Create new localdb instance

sqllocaldb.exe create "Dev" 11.0  -s
This creates a localdb instance named Dev using the VStudio 2013 binaries and starts it.



Create  new database when getting "file already exists" errlr
-- open new query window against master db:

CREATE DATABASE CLFM ON (NAME = 'CLFM', FILENAME = 'C:\Users\vafsctonnet\UTest\CLFM.mdf')
LOG ON (NAME = 'CLFM_log', FILENAME = 'C:\Users\vafsctonnet\UTest\CLFM.ldf')

Efficient way to programmatically create localdb

http://www.jefclaes.be/2014/10/programmatically-force-create-new.html

Command line commands

from VStudio CMD:

get info on all db's on machine
SqlLocalDB.exe info
info on one db
SqlLocalDB.exe info UTest

SqlLocalDB.exe stop UTest
SqlLocalDB.exe start UTest

Make a copy of an existing database 

Make copies of the .ldf and .mdf files.
Then in server, right click Databases folder and select Attach. Select .mdf file. Done.

Monday, December 1, 2014

OO vs FP

The bottom, bottom line here is simply this. OO programming is good, when you know what it is. Functional programming is good when you know what it is. And functional OO programming is also good once you know what it is.

http://blog.cleancoder.com/uncle-bob/2014/11/24/FPvsOO.html

The Hacker Way - Facebook

Article

“Done is better than perfect”.

“Code wins arguments.”

“The riskiest thing is to take no risks.”

“Move fast and break things.” The idea is that if you never break anything, you’re probably not moving fast enough.