Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Class1
- {
- public static SqlString GetName(SqlString str)
- {
- SqlCommand cmd = new SqlCommand(str.ToString());
- cmd.CommandType = System.Data.CommandType.Text;
- string name = cmd.ExecuteScalar().ToString();
- return name;
- }
- }
- CREATE FUNCTION fn_TestConnection
- (
- @str nvarchar(255)
- )
- RETURNS nvarchar(max)
- AS EXTERNAL NAME TestConnection.[TestConnection.Class1].GetName
- GO
- SELECT dbo.fn_TestConnection('SELECT FName FROM Clients WHERE Id = 1' )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement