Hi Hazira,
Without DDL, here's some code you can use (vb .net - change to c# as
necessary):
Dim creationstring As String
If glf_custstat = "" Then
creationstring = "CREATE PROCEDURE sp_buildbranchlist AS "
creationstring += " select imcacct, brname, addr, addr2, city, st, zip,
custstat into branchlist from branches"
creationstring += vbCrLf & "where imcacct in " & longstring
Else
creationstring = "CREATE PROCEDURE sp_buildbranchlist AS "
creationstring += " select imcacct, brname, addr, addr2, city, st, zip,
custstat into branchlist from branches"
creationstring += vbCrLf & "where imcacct in " & longstring & " and custstat
= '" & glf_custstat & Chr(39)
End If
Dim sqladapt As New SqlDataAdapter
sqladapt.SelectCommand = New SqlCommand(creationstring, oconn)
Try
sqladapt.SelectCommand.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
HTH,
Bernie Yaeger