I am trying to write a SP to simply count rows from a table. Its just a bit
of learning for me, and although I have written other SPs which pass values,
I am having trouble with this.
Here is the code I am testing in Query yser:
Declare MyField varchar (128)
Declare MyTable table
Set MyTable = 'DMS_Ref_DBobject_Types'
Set MyField = 'ObjectTypeID'
SELECT Count(Myfield)FROM MyTable
Here is the error message:
Server: Msg 156, Level 15, State 1, Line 4
Incorrect syntax near the keyword 'Set'.
Server: Msg 137, Level 15, State 1, Line 5
Must declare the variable ...