Blog

Adding linked servers in SQL farm

Handy lines for adding linked servers in your SQL farm:

   exec sp_addlinkedserver @server = ‘SQLSERVERNAME’, @srvproduct = N”, @provider=N’SQLNCLI’, @datasrc = ‘SERVERNAME’

   exec sp_addlinkedsrvlogin @rmtsrvname = ‘SQLSERVERNAME’, @useself = ‘false’, @locallogin = ‘login_svc’, @rmtuser = ‘user_svc’, @rmtpassword = ‘********’

 

SQL function to split string

Here’s a handy user defined function to split string into comma separated line:

/****** Object: UserDefinedFunction [dbo].[ufnSplitString] Script Date: 19/11/2015 11:18:20 AM ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE FUNCTION [dbo].[ufnSplitString](

@String varchar(max),

@Delimiter char(1),

@Column int = 1

)

Read More

Prevent users from accessing Site Settings application page

Just this week, I accidentally found out that users were able to access Site Settings page, with some sections open out publicly accessible, for example the Regional Settings column! This raise a security threat as we don’t want users to be able to touch these settings. After much digging, I realised it’s because one custom permission that was created for the users have “Browser Directories” permission checked. Once this is unchecked, then they are denied from accessing the setting page.