How to get week number of the month from the date in sql server 2008

Here are 2 different ways, both are assuming the week starts on monday If you want weeks to be whole, so they belong to the month in which they start: So saturday 2012-09-01 and sunday 2012-09-02 is week 4 and monday 2012-09-03 is week 1 use this: DECLARE @date date=”2012-09-01″ SELECT (day(datediff(d,0,@date)/7*7)-1)/7+1 If your weeks … Read more

How to deploy SQL Server Compact Edition 4.0?

i’ve created the solution. SQL Server Compact Edition is comprised of 7 dlls: sqlceme40.dll The undocumented, native, flat API library (The .net System.Data.SqlServerCe.dll assembly is a wrapper around this dll) sqlceca40.dll A COM dll that implements Engine, Replication, Error and a few other COM objects sqlceoledb40.dll A COM dll that implements an OLEdb provider for … Read more

Reporting Services permissions on SQL Server R2 SSRS

This did the trick for me. http://thecodeattic.wordpress.com/category/ssrs/. Go down to step 35 to see the error you are getting. Paraphrasing: Once you’re able to log in to YourServer/Reports as an administrator, click Home in the top-right corner, then Folder Settings and New Role Assignment. Enter your user name and check a box for each role … Read more

storing passwords in SQL Server

The usual way to store password, is to use a hash function on the password, but to salt it beforehand. It is important to “salt” the password, to defend oneself against rainbow table attacks. So your table should look something like that ._______._________________.______________. |user_id|hash |salt | |——-|—————–|————–| |12 |adsgasdg@g4wea…|13%!#tQ!#3t…| | |… |… | When checking … Read more