Forum Replies Created

Viewing 15 posts - 2,251 through 2,265 (of 3,233 total)

  • RE: output variables

    Well, in all fairness, your example isn't really telling me anything, it is about as vague as you can get.  Secondly, those are output parameters, not input parameters.  The only...

  • RE: output variables

    CREATE PROCEDURE dbo.OutputTest @Year int OUTPUT, @Year1 int OUTPUT, @Year2 int OUTPUT

    AS

    SELECT @Year = 2006,

        @Year1 = 2005,

        @Year2 = 2004

    GO

    DECLARE @returnValue int,

        @returnValue1 int,

        @returnValue2 int

    EXEC dbo.OutputTest @returnValue OUTPUT,@returnValue1...

  • RE: Ranking records in query results

    Mark,

    Keep in mind that the UNION statements are only there to populate the initial test data for the example.  That test data is then used in place where your...

  • RE: IDENTITY_INSERT and SELECT *

    In addition to what Lynn has posted:

    It looks like you are performing this action on a number of tables hence the dynamic SQL.  Don't forget to set the IDENTITY_INSERT back...

  • RE: Getting select records from one tabel to another

    INSERT INTO Table3 (<column list&gt

    SELECT <your select that you used to identify the 30,000 missing rows>

  • RE: INsert 0 instead of NULL

    I would go with Matt's suggestions as COALESCE is the ANSI preferred method as opposed to ISNULL.

  • RE: What needs done to get cursor out of un needed loop

    You need to add another fetch next into your begin/end block like so:

    CREATE TABLE #backupmissed(dbname VARCHAR(50),lastbackup VARCHAR(21))

    SET ansi_warnings OFF

    SET NOCOUNT on

    DECLARE @names VARCHAR(30)

    INSERT INTO #backupmissed(dbname,lastbackup)

    SELECT A.database_name as 'DBName',

        A.backup_finish_date...

  • RE: LIKE%

    I'm still not exactly sure what you're after but here you go:

     

    DECLARE @table TABLE (value varchar(100))

    INSERT INTO  @table

    SELECT 'Please help me because I cant help myself' UNION ALL

    SELECT 'u...

  • RE: LIKE%

    Can you provide an example of what you are trying to do and include sample data and results?

  • RE: Help with Query

    SELECT AuditDateTime,

        SUM(COALESCE(ColA,0)) AS colA,

        SUM(COALESCE(ColB,0)) AS colB,

        SUM(COALESCE(ColC,0)) AS colC

    FROM #a

    GROUP BY AuditDateTime

  • RE: Calendar and Business day functions

    Create a calendar or dates table.  Do a search on SSC for calendar table or dates table.  There are many threads on this topic.

  • RE: Ranking records in query results

    Great post Jeff.  I wanted to run through a test after David posted the question of performance, but I didn't have the time to get one put together.  I did...

  • RE: User Specific Persistent Temporary Table

    Because the temp table resided in TempDB, you will not be able to rename the table using sp_rename as sp_rename will not allow you to...

  • RE: Last Time An SP Was Run

    Unless there is logic within your stored procedure to write a run history to an audit table, there is really no way to know the last time a SP has...

  • RE: converting a column from int to char

    1. Drop all foreign keys and constraints on the affected columns. 

    2. Run ALTER TABLE <tableName> ALTER COLUMN <columnName> [char].... commands for each table/column to change.

    3. Re-create all constraints.

Viewing 15 posts - 2,251 through 2,265 (of 3,233 total)