How To: SQL Server Reporting Date Formating
To select a date format, wrap your field value in a format statement
= Format(Fields!DateFieldToFormat.Value,”M/d/yyyy”)
It is as simple as that!
To select a date format, wrap your field value in a format statement
= Format(Fields!DateFieldToFormat.Value,”M/d/yyyy”)
It is as simple as that!
I recently created a SQL database that has to store files as blobs but before doing so a vb.net CLR function performs an MD5 has on the file to store with it. Everything runs great typically except for on occassion a very large file (4MB) will come along and blow the following error, “.NET Framework execution was aborted by escalation policy because of out of memory“.
To date I’ve tried several settings on SQL Server (2005) unsuccessfully so for now the only way I’ve been able to get around this is to run this SQL command:
DBCC FREESYSTEMCACHE ('ALL')
Running the above SQL command allowed memory to be cleared so the file could be loaded.
Previous research has shown possible fixes based around MemToLeave setting of SQL Server which appears to be a major undertaking!
On occasion it is handy to have a SQL snippet to find SQL views in a database that are using a particular table, column, function, or other SQL. Fortunately SQL Server offers several information schema views to help out.
Using the system view INFORMATION_SCHEMA.VIEWS you can query the views definition (think the SQL you used to create the view). It is as simple as searching the system views VIEW_DEFINITION column. See the example below:
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS WHERE VIEW_DEFINITION LIKE '%search criteria%'
Similarly you can search stored procedures using the example below:
SELECT ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_DEFINITION LIKE '%search criteria%'
Applies to: MS SQL Server 2005
On machines where Vista/W7 is installed there appears to be an issue when checking to see if a user is in a role. User Account Control (UAC) must be on to reproduce the issue. The result is that the value returned is always FALSE even when the user does belong to the group.
If My.User.IsInRole(“My Domain\My Group”) Then
Return True
Else
Return False
End If
To get around this I created a function using other .Net functions.
Public Function IsInUserRole(ByVal RoleToFind As String) As Boolean
Dim id As WindowsIdentity = WindowsIdentity.GetCurrent
Dim irc As IdentityReferenceCollection
‘ Gets a SID list of groups the user belongs to
irc = id.Groups
For Each ir As IdentityReference In irc
‘ Need to convert the SID to plain english
Dim act As NTAccount = CType(ir.Translate(Type.GetType("System.Security.Principal.NTAccount")), NTAccount)
If act.Value = RoleToFind Then
Return True
End If
Next
Return False
End Function
Next week I’ll be attending RailsConf 09 in Las Vegas, NV. Since I’m still pretty new to Rails I’m taking one of the tutorial classes “A-Z Intro to Rails Tutorial” and the presenter has already provided info from his site. Cool!
Upon continuing a Ruby on Rails project after a few months delay, Aptana Studio’s RadRails editor installed some updates. I suspect something that changed in Rails itself (GEM update) caused the error I received.
undefined method `include_root_in_json=’ for ActiveRecord::Base:Class (NoMethodError)
To fix this error rename the config/initializers/new_rails_defaults.rb to config/initializers/new_rails_defaults.rb.bak.
It appears that the old code placed in these files no longer works with ROR 2.0.2.
# These settings change the behavior of Rails 2 apps and will be defaults
# for Rails 3. You can remove this initializer when Rails 3 is released.# Include Active Record class name as root for JSON serialized output.
ActiveRecord::Base.include_root_in_json = true# Store the full class name (including module namespace) in STI type column.
ActiveRecord::Base.store_full_sti_class = true# Use ISO 8601 format for JSON serialized times and dates.
ActiveSupport.use_standard_json_time_format = true# Don’t escape HTML entities in JSON, leave that for the #json_escape helper.
# if you’re including raw json in an HTML page.
ActiveSupport.escape_html_entities_in_json = false
The file now created in a new project appears as follows:
# These settings change the behavior of Rails 2 apps and will be defaults
# for Rails 3. You can remove this initializer when Rails 3 is released.if defined?(ActiveRecord)
# Include Active Record class name as root for JSON serialized output.
ActiveRecord::Base.include_root_in_json = true# Store the full class name (including module namespace) in STI type column.
ActiveRecord::Base.store_full_sti_class = true
end# Use ISO 8601 format for JSON serialized times and dates.
ActiveSupport.use_standard_json_time_format = true# Don’t escape HTML entities in JSON, leave that for the #json_escape helper.
# if you’re including raw json in an HTML page.
ActiveSupport.escape_html_entities_in_json = false
See http://www.hostingrails.com/1461/dbmigrate-undefined-method-include_root_in_json for more help with this error.
Eye-tracking studies are hot in the web design world, but it can be hard to figure out how to translate the results of these studies into real design implementations. These are a few tips from eye-tracking studies that you can use to improve the design of your blog or site.