Forum Replies Created

Viewing 6 posts - 46 through 51 (of 51 total)

  • RE: Function to get "day of Quarter" in T-SQL or DTS ?

    hey,

    i think the answer is:

    CREATE FUNCTION dbo.fn_day_of_quarter(@dayInQuarter AS DATETIME) RETURNS INTEGER

    AS

    BEGIN

      DECLARE @month AS INTEGER

      SET @month = DATEPART(m, @dayInQuarter)

      DECLARE @firstDayInQuarter AS DATETIME

     ...

  • RE: An INSERT EXEC statement cannot be nested.

    hey francisco,

    my suggestions would be the following:

    (1) Try getting rid of the INSERT statements inside the proc

    (2) If suggestion 1 is not feasible, then the other option is to try...

  • RE: sp_ExecuteSQL

    if you are referring about the return value of a user-defined function or the value of an output parameter of a stored procedure, then the answer is yes ...

  • RE: Distinct () conundrum

    assumming both columns are some type of integer, trying doing a bitwise AND on both columns in your SELECT DISTINCT clause as follows:

    SELECT DISTINCT(ti.tactical_issue_id & ti2.tactical_issue_id), ti.tactical_issue_id as ti1,...

  • RE: Stored Procedure Polymorphism ??

    hey, this should work:

    SQL for one parameter:

    SELECT ServerName, Environment, ServerRole FROM V_ServerDetail

     WHERE ServerName = @ServerName OR @ServerName IS NULL

     ORDER BY ServerName

    SQL for two parameter(s):

    SELECT...

  • RE: sp_ExecuteSQL

    hey francis,

    you would need to do something like the example below:

    -- [BEGIN] : Code Snippet

    DECLARE @SQLText AS NVARCHAR(500)

    SET @SQLText = N'SELECT @Itemout=some_field FROM Some_Table WHERE some_other_field...

Viewing 6 posts - 46 through 51 (of 51 total)