Grant execute for all sp

select ‘grant execute on ‘ +
    QuoteName(specific_schema) + ‘.’ +
    QuoteName(specific_name) + ‘ to ta_user’
from information_schema.routines
where routine_type=’PROCEDURE’

No Comments »

Sql Server Restore DB from T-SQL

USE MASTER
GO
 
 
ALTER DATABASE TA_DEV
SET SINGLE_USER WITH ROLLBACK IMMEDIATE
Go
 
 
RESTORE DATABASE TA_DEV
FROM DISK = N’[C:\8ninths\data\2012.11.26.02.bak]‘
Go
 
 
ALTER DATABASE TA_DEV
SET MULTI_USER with ROLLBACK IMMEDIATE
Go

No Comments »

Job Interview Questions from Candidate

http://www.inc.com/jeff-haden/5-questions-great-job-candidates-ask-interviewers.html

What do you expect me to accomplish in the first 60 to 90 days?

What are the common attributes of your top performers?

What are a few things that really drive results for the company?

What do employees do in their spare time?

How do you plan to deal with…?

No Comments »

String Resource Insert Update Cursor

/*
delete from StringResources
where resourceType = ‘MicrosoftPropertyGroupPerformance’

update MicrosoftPropertyGroupPerformance set StringResourceKey = null

select * from StringResources where resourceValue = ‘ Audience consumed any of these alcoholic beverages in the last 30 days’

select * from MicrosoftPropertyGroupPerformance
select * from StringResources where resourceType = ‘MicrosoftPropertyGroupPerformance’ order by resourceValue

SELECT ‘MicrosoftPropertyGroupPerformance’, ‘en’, ‘tblMicrosoftPropertyGroupPerformance.’ + Convert(nvarchar(10),a.Id) + ‘.Footnote’, RTrim(LTrim(a.Footnote))
FROM MicrosoftPropertyGroupPerformance A
Inner Join (select distinct Footnote as Footnote from MicrosoftPropertyGroupPerformance ) B
    On b.Footnote = a.Footnote
Order by a.Id
*/
Declare @rowId int
Declare @footnote varchar(255)

select @rowId = 1;

DECLARE DistinctMicrosoftPropertyFootnote CURSOR FOR
SELECT distinct Footnote as Footnote from MicrosoftPropertyGroupPerformance;
OPEN DistinctMicrosoftPropertyFootnote;

FETCH NEXT FROM DistinctMicrosoftPropertyFootnote;
WHILE @@FETCH_STATUS = 0
   BEGIN
      FETCH NEXT FROM DistinctMicrosoftPropertyFootnote INTO @footnote;
     
      BEGIN
      Insert into dbo.StringResources
      select ‘MicrosoftPropertyGroupPerformance’, ‘en’, ‘tblMicrosoftPropertyGroupPerformance.’ + Convert(nvarchar(10),@rowId) + ‘.Footnote’, @footnote
     
      Update MicrosoftPropertyGroupPerformance Set
      StringResourceKey = ‘tblMicrosoftPropertyGroupPerformance.’ + Convert(nvarchar(10),@rowId) + ‘.Footnote’
      where Footnote = @footnote
     
      select @rowId = @rowId + 1
     
      END
   END;
CLOSE DistinctMicrosoftPropertyFootnote;
DEALLOCATE DistinctMicrosoftPropertyFootnote;
GO

No Comments »

Build Anonymous Type in Asp.net

http://beyondrelational.com/modules/2/blogs/61/posts/11203/anonymous-types-in-c-or-vb-net.aspx

http://stackoverflow.com/questions/331976/how-do-i-serialize-a-c-sharp-anonymous-type-to-a-json-string

http://stackoverflow.com/questions/12111321/how-to-serialize-an-anonymous-type-to-json-when-json-needs-properties-with-ch

http://peterkellner.net/2010/05/14/unit-test-jsonresult-aspnet-mvc-reflection/

image

No Comments »

Asp.net database resource strings management

http://eyefetch.wordpress.com/2012/03/20/the-global-village-13/#comments

No Comments »

app_data access denied

make sure web app has trust level of full

make sure app pool uses network service identiy and that network service identity has full control of directory

No Comments »

Azure Deployment Remote Debug Certificate Preparation

image

No Comments »

Azure federated access to web service data (odata, wcf)

When Sean Iannuzzi was asked to secure a Web service for an existing database and Web application, he saw the benefits of using OData, but he didn’t think it was secure enough. See how he developed his own custom implementation with extra security.

Article

Download

No Comments »

99 designs

http://99designs.com/

No Comments »

WP Login