Tuesday, October 26, 2010

FILESTREAM feature doesn't have file system access enabled.

Run this:


sp_configure 'filestream access level',2


and then this:


RECONFIGURE WITH OVERRIDE


in the database in question (not in the master db)

I also enable these two options as well (but don't know if they have to be enabled):



Source: http://blogs.msdn.com/b/chrissk/archive/2009/02/08/example-using-transactional-replication-with-filestreams-in-sql-2008.aspx

Thursday, October 21, 2010

Add Column the safe way


if not exists ( select 1 from sys.tables t
join sys.columns c on c.object_id = t.object_id
where t.name = 'Users' and c.name = 'IsAdmin')
BEGIN
ALTER TABLE Users
ADD IsAdmin bit NOT NULL
END
GO

Tuesday, October 12, 2010

jeditable maxlength

In jquery.jeditable.js add:
if (settings.maxlength) { input.attr('maxlength', settings.maxlength); }

right below:
if (settings.height != 'none') { input.height(settings.height); }



Then set maxlength
$('.loremipsum').editable('http://www.example.com/save.php', {
    ...
    maxlength: 20
});

reference: http://www.appelsiini.net/projects/jeditable (user Sasi's comment)

Friday, October 8, 2010

Sintax

From:
http://alexgorbatchev.com/SyntaxHighlighter/integration.html
http://www.cyberack.com/2007/07/adding-syntax-highlighter-to-blogger.html

Adding to the pre tag the following: class="brush: sql;"

select * from users where 1 = 1


int i = 0;


function helloSyntaxHighlighter()
{
return "hi!";
}

http://alexgorbatchev.com/SyntaxHighlighter/

Thursday, October 7, 2010

FILESTREAM feature is disabled

Msg 5591, Level 16, State 1, Line 2
FILESTREAM feature is disabled.

In SQL Server Configuration Manager

Wednesday, October 6, 2010

The subscription(s) have been marked inactive and must be reinitialized

The subscription(s) have been marked inactive and must be reinitialized. NoSync subscriptions will need to be dropped and recreated. (Source: MSSQLServer, Error number: 21074)

At publisher:

use distribution
go

update MSSubscriptions set [status] = 2

To review pending commands to replicate. At plusblisher:

use distribution
go

exec sp_browsereplcmds

Tuesday, October 5, 2010

Binding settings (long messages)

One of the service's operations sends a pretty long response message, using the defaults settings will result in an exception.

To fix this, update maxBufferSize and maxReceivedMessageSize to a greater value (they both default to 65536) in the client.



...
< name="longHttpMessages" maxbuffersize="2147483647" maxreceivedmessagesize="2147483647">
...

end