/*
USE [master]
GO

sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'clr enabled', 1;
GO
RECONFIGURE;
GO

ALTER DATABASE TISNET SET TRUSTWORTHY ON
GO

USE [TISNet]
GO
CREATE SCHEMA [Uloziste] AUTHORIZATION [dbo]
GO

*/
 
USE [TISNet]
GO
/****** Object:  StoredProcedure [Uloziste].[UlozSouborDoUlozisteTISu]    Script Date: 07/09/2009 17:47:32 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[Uloziste].[UlozSouborDoUlozisteTISu]') AND type in (N'P', N'PC'))
DROP PROCEDURE [Uloziste].[UlozSouborDoUlozisteTISu]
GO
/****** Object:  StoredProcedure [Uloziste].[DejSouborZUlozisteTISu]    Script Date: 07/09/2009 17:47:16 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[Uloziste].[DejSouborZUlozisteTISu]') AND type in (N'P', N'PC'))
DROP PROCEDURE [Uloziste].[DejSouborZUlozisteTISu]
GO
/****** Object:  SqlAssembly [TISClrLibrary]    Script Date: 07/09/2009 17:48:05 ******/
IF  EXISTS (SELECT * FROM sys.assemblies asms WHERE asms.name = N'TISClrLibrary' and is_user_defined = 1)
DROP ASSEMBLY [TISClrLibrary]
GO

Create ASSEMBLY [TISClrLibrary] FROM '"c:\\Program Files\\topspin\\TISNet\\bin\\topspin\\TISClrLibrary.dll'
 WITH PERMISSION_SET = UNSAFE
GO

/****** Object:  StoredProcedure [Uloziste].[DejSouborZUlozisteTISu]    Script Date: 07/09/2009 08:52:22 ******/
CREATE PROCEDURE [Uloziste].[DejSouborZUlozisteTISu]
	@souborId [uniqueidentifier],
	@data [varbinary](max) OUTPUT,
	@nazev [nvarchar](255) OUTPUT
WITH EXECUTE AS CALLER
AS
EXTERNAL NAME TISClrLibrary.[StoredProcedures].[DejSouborZUlozisteTISu]
GO

/****** Object:  StoredProcedure [Uloziste].[UlozSouborDoUlozisteTISu]    Script Date: 07/09/2009 08:52:57 ******/
CREATE PROCEDURE [Uloziste].[UlozSouborDoUlozisteTISu]
	@podaciDenikId [uniqueidentifier],
	@souborId [uniqueidentifier],
	@nazev [nvarchar](255),
	@data [varbinary](max)
WITH EXECUTE AS CALLER
AS
EXTERNAL NAME TISClrLibrary.[StoredProcedures].[UlozSouborDoUlozisteTISu]
GO
