Newbie stored procedure question

    Date: 01/26/06 (SQL Server)    Keywords: google

    I'm trying to create a stored procedure that will generate and return a unique identifier when called.

    Here's my stored procedure code:

    CREATE PROCEDURE sp_tc_createuniqueid AS
    
    DECLARE @uid uniqueidentifier
    SET @uid = newid()
    
    RETURN @uid
    


    I'm getting the error: "Operand type clash: uniqueidentifier is incompatible with int"

    After a few Google searches, I'm stuck as to how to fix this. Help!

    Thanks.

    Source: http://community.livejournal.com/sqlserver/41602.html

« The phantom truncation. || What to teach a newbie. »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home