using System;
using System.Data;
using System.Data.Sql;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
using System.IO;


public partial class StoredProcedures
{
	[Microsoft.SqlServer.Server.SqlProcedure]
	public static void GetFile()
	{
		using (System.Security.Principal.WindowsIdentity id =
					SqlContext.WindowsIdentity)
		{
			System.Security.Principal.WindowsImpersonationContext c = id.Impersonate();
			StreamReader sr = new StreamReader(@"C:\file.txt");
			string s = sr.ReadLine();
			sr.Close();
			c.Undo();
			SqlContext.Pipe.Send(s);
		}   
	}
};
