Code: Select all
CREATE PROCEDURE tsp_ItemIDtoString (@ItemID binary(8), @SItemID nvarchar(32) output) AS
/*
*
* tsp_ItemIDtoString
*
* Returns a comma separated string representation
* of an item id
*
* Parameters:
* @ItemID - (I) binary 8 byte item id
* @SItemID - (O) string representation of item id
*
*/
declare @i as int
set @SItemID = ""
if (@ItemID is not null) begin
set @i = 8
while (@i > 0) begin
select @SItemID = "," + cast(cast(substring(@ItemID, @i ,1) as int) as varchar) + @SItemID
set @i = @i -1
end
set @SItemID = right(@SItemID, len(@SItemID) - 1 )
end
Code: Select all
An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Change the alias to a valid name.
Wenn ich Fügen Sie die folgenden Zeilen vor der gespeicherten Prozedur in SSMS hinzu, dann wird es erfolgreich sein:
Code: Select all
SET QUOTED_IDENTIFIER OFF;
GO
...(The above stored procedure).
Ich gehe wie folgt vor:< /p>
Code: Select all
pConnection->Execute(_T("SET QUOTED_IDENTIFIER OFF;");
pConnection->Execute(strDefinition); // strDefinition is the above stored procedure.
Warum funktioniert die Lösung für SSMS, aber nicht in ADO?