• Bhuvnesh (11/11/2008)


    hi ken,

    thanks it works:)

    but can u explain the whole scenario.

    Here this may help a little:

    DECLARE @word sysname

    EXEC sp_executesql

    N'SELECT TOP 1 @DynamicWord = [name] FROM sysobjects' --dynamic sql query to execute

    ,N'@DynamicWord sysname OUTPUT' --parameter definitions

    ,@DynamicWord=@word OUTPUT --assigning the caller procs local variable to the dynamic parameter

    SELECT @word