I have a SQL CLR dll I want to deploy, but have found you can embed the byte stream/varbinary_literal/ varbinary_expression/assembly bits into a text file to get around the messy hassle of packaging a DLL and making sure it's accessible for the CREATE ASSEMBLY command.

But what I have yet to find is how to get that byte stream/varbinary_literal/ varbinary_expression/assembly bits value.  I haven't found any consistent terminology, and what I keep finding in using Load().

Help?


Question: How to solve this stochastic integrals?
Answer: Besides applying the Itô formula, there is also the possibility to calculate a stochastic integral using approximation by step functions. It works fine for the integral $\int_0^T B_t \, dB_t$:

Let

$$f_n(t,\omega) := \sum_{j=1}^n 1_{[t_{j-1},t_{j})}(t) \cdot B_{t_{j-1}}(\omega)$$

where $\Pi_n$ is a partition of $[0,T]$ such that $$\max_{t_j \in \Pi_n} |t_j-t_{j+1}| \to 0 \qquad (n \to \infty)$$

Since the Brownian motion has continuous paths, it's not difficult to show that $(f_n)_{n \in \mathbb{N}}$ is an approximating sequence as required in the definition of the stochastic integral, therefore

$$\int_0^T f_n(t) \, dB_t \stackrel{L^2}{\to} \int_0^T B_t \, dB_t \qquad (n \to \infty)$$

By definition, it's easy to calculate the stochastic integral of step functions:

$$\int_0^T f_n(t) \, dB_t = \sum_{j=1}^n B_{t_{j-1}} \cdot (B_{t_{j}}-B_{t_{j-1}}) \tag{1} $$

On the other hand, we have

$$\begin{align} B_T^2 &amp;= \left( \sum_{j=1}^n B_{t_j}-B_{t_{j-1}} \right) \cdot \left( \sum_{k=1}^n B_{t_k}-B_{t_{k-1}} \right) =\underbrace{\sum_{j=1}^n (B_{t_j}-B_{t_{j-1}})^2}_{\stackrel{L^2}{\to} T} + 2 \underbrace{\sum_{j=1}^n B_{t_{j-1}} \cdot (B_{t_j}-B_{t_{j-1}})}_{\stackrel{(1)}{\to} \int_0^T B_t \, dB_t}. \end{align}$$

Thus, $$B_T^2 = T +  2 \int_0^T B_t \, dB_t.$$