Showing posts with label included. Show all posts
Showing posts with label included. Show all posts

Thursday, March 22, 2012

Difference b/w SPs & Functions

1. cannot hv tran in functions
2. cannot include SPs in select queries or in from clause whereas functions
can be included. (exception using OPENQUERY for including SP in from clause)
What other differences?Hi Rakesh
Difference between Stored Procedure and UDF:
Returning Parameters:
UDF Should return a parameter
Stored Procedure need not return any value
UDF Returns only one parameter
Stored Procedures can return more than one parameters
UDF can return a table
Stored Procedure returns a resultset
Usage
UDFs can be used a inline functions and can also be executed explicitly
eg: inline function: SELECT getdate()
Stored Procedures cannot be used as inline functions
Hope this helps you.
Please let me know if u have any questions
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---
"Rakesh" wrote:

> 1. cannot hv tran in functions
> 2. cannot include SPs in select queries or in from clause whereas function
s
> can be included. (exception using OPENQUERY for including SP in from claus
e)
>
> What other differences?|||You cannot use INSERT/UPDATE/DELETE on base tables.
You cannot Use NonDeterministic functions inside UDF
A scalar valued user defined function can be used Anywhere a value is
expected, as in WHERE clause, check contraint etc.
Roji. P. Thomas
Net Asset Management
http://toponewithties.blogspot.com
"Rakesh" <Rakesh@.discussions.microsoft.com> wrote in message
news:8DDCFBA3-C85D-47A4-A2CE-CDC22EEA364F@.microsoft.com...
> 1. cannot hv tran in functions
> 2. cannot include SPs in select queries or in from clause whereas
> functions
> can be included. (exception using OPENQUERY for including SP in from
> clause)
>
> What other differences?|||Rakesh
Visit at http://www.sql-server-performance.com/
"Rakesh" <Rakesh@.discussions.microsoft.com> wrote in message
news:8DDCFBA3-C85D-47A4-A2CE-CDC22EEA364F@.microsoft.com...
> 1. cannot hv tran in functions
> 2. cannot include SPs in select queries or in from clause whereas
> functions
> can be included. (exception using OPENQUERY for including SP in from
> clause)
>
> What other differences?|||"Chandra" wrote in message

> Difference between Stored Procedure and UDF:
> Returning Parameters:
> UDF Should return a parameter
> Stored Procedure need not return any value
Stored Procedures RETURN a value, even if you dont explicitly specify (0 by
default)

> UDF Returns only one parameter
> Stored Procedures can return more than one parameters
Stored Procedure can RETURN one one value and that must be integer.
You can use Output Parameters to get other datatypes back from the SP

> UDF can return a table
> Stored Procedure returns a resultset
Stored Procs can return multiple recordsets, UDF can return only one (table
valued udfs)

> UDFs can be used a inline functions and can also be executed explicitly
> eg: inline function: SELECT getdate()
What you mean by inline?

> Stored Procedures cannot be used as inline functions
EXEC yourvar= ProcName <ParamList>
Just plain Nitpicking :)
Regards
Roji. P. Thomas
http://toponewithties.blogspot.com

Friday, March 9, 2012

device is ambiguous in the namespace microsoft.directx.direc3d

Can anybody tell me what this error message means. I get it when trying to use directx3d. The code is included below.

I have checked and double checked that I have all the necessary references and includes. Obviously I am missing something.
Thanks Dick

Imports System

Imports System.Drawing

Imports System.Windows.Forms

Imports Microsoft.DirectX

Imports Microsoft.DirectX.Direct3D

Public Class Form1

Inherits System.Windows.Forms.Form

Dim device As Device ' Our rendering device

#Region "Windows Form Designer generated code "

Public Sub New()

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

End Sub

'Form overrides dispose to clean up the component list.

Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean)

If Disposing Then

If Not components Is Nothing Then

components.Dispose()

End If

End If

MyBase.Dispose(Disposing)

End Sub

'Required by the Windows Form Designer

#End Region

Public Function InitializeGraphics() As Boolean

Try

' Now let's setup our D3D stuff

Dim presentParams As PresentParameters = New PresentParameters()

presentParams.Windowed = True

presentParams.SwapEffect = SwapEffect.Discard

device = New Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presentParams)

Return True

Catch

Return False

End Try

End Function

Private Sub Render()

If device Is Nothing Then

Exit Sub

End If

'Clear the backbuffer to a blue color

device.Clear(ClearFlags.Target, System.Drawing.Color.Blue, 1.0F, 0)

'Begin the scene

device.BeginScene()

' Rendering of scene objects can happen here

'End the scene

device.EndScene()

device.Present()

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

If Not InitializeGraphics() Then

MessageBox.Show("Could not initialize Direct3D. This tutorial will exit.")

Exit Sub

End If

Me.Show()

' While the form is still valid, render and process messages

Do While Me.Created

Render()

Application.DoEvents()

Loop

End Sub

End Class

This is a SQL Server forum. I think you've accidentally posted to the wrong place...

Wednesday, March 7, 2012

device is ambiguous in the namespace microsoft.directx.direc3d

Can anybody tell me what this error message means. I get it when trying to use directx3d. The code is included below.

I have checked and double checked that I have all the necessary references and includes. Obviously I am missing something.
Thanks Dick

Imports System

Imports System.Drawing

Imports System.Windows.Forms

Imports Microsoft.DirectX

Imports Microsoft.DirectX.Direct3D

Public Class Form1

Inherits System.Windows.Forms.Form

Dim device As Device ' Our rendering device

#Region "Windows Form Designer generated code "

Public Sub New()

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

End Sub

'Form overrides dispose to clean up the component list.

Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean)

If Disposing Then

If Not components Is Nothing Then

components.Dispose()

End If

End If

MyBase.Dispose(Disposing)

End Sub

'Required by the Windows Form Designer

#End Region

Public Function InitializeGraphics() As Boolean

Try

' Now let's setup our D3D stuff

Dim presentParams As PresentParameters = New PresentParameters()

presentParams.Windowed = True

presentParams.SwapEffect = SwapEffect.Discard

device = New Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presentParams)

Return True

Catch

Return False

End Try

End Function

Private Sub Render()

If device Is Nothing Then

Exit Sub

End If

'Clear the backbuffer to a blue color

device.Clear(ClearFlags.Target, System.Drawing.Color.Blue, 1.0F, 0)

'Begin the scene

device.BeginScene()

' Rendering of scene objects can happen here

'End the scene

device.EndScene()

device.Present()

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

If Not InitializeGraphics() Then

MessageBox.Show("Could not initialize Direct3D. This tutorial will exit.")

Exit Sub

End If

Me.Show()

' While the form is still valid, render and process messages

Do While Me.Created

Render()

Application.DoEvents()

Loop

End Sub

End Class

This is a SQL Server forum. I think you've accidentally posted to the wrong place...