Forum Replies Created

Viewing 15 posts - 661 through 675 (of 2,647 total)

  • RE: looping through dates in a table

    Can you please give the DDL for the table (CREATE TABLE .... )?

    Jared
    CE - Microsoft

  • RE: looping through dates in a table

    So... You want to GROUP BY ref and then compute the difference (DATEDIFF()) between the two dates when the data is ordered by the date? What does template have...

    Jared
    CE - Microsoft

  • RE: combine two queries into one

    SQL_NuB (6/14/2012)


    I'm working on converting an access db to SQL and I came across several Access queries that are the same with the exception of 1 parameter in the where...

    Jared
    CE - Microsoft

  • RE: combine two queries into one

    Well, without DDL my only suggestion is to place them in a blender and hit puree. 🙂 Please provide us with DDL and sample data with sample expected output.

    Jared
    CE - Microsoft

  • RE: newbie to sql

    I think that the best way to learn it is to use it with some free online tutorials. tart here.[/code] Then visit the forums and try to figure...

    Jared
    CE - Microsoft

  • RE: Unpivoting Data

    Ok. Try this for the numbers:

    SELECT APUserID, CAST(TypeId AS INT) AS TypeId, Something

    FROM

    (SELECT APUserID, FirstName AS '1', Surname AS '2', UserName AS '3', Identifier AS...

    Jared
    CE - Microsoft

  • RE: Unpivoting Data

    anthony.green (6/14/2012)


    HI All.

    Think I'm just having one of them days today and cant get my head around this.

    What I need to do is unpivot the following data into multiple rows.

    DECLARE...

    Jared
    CE - Microsoft

  • RE: Kill All Spid(s) according to Database Name

    Lowell (6/14/2012)


    here's something i use a lot;

    it's just a proc that cursors thru all the spids for a given database name;

    sp_kill SandBox would kill all spids attached to the database,...

    Jared
    CE - Microsoft

  • RE: How to Pass Optional parameters in SSIS

    I'm not sure I understand... If it is a job, how will you optionally pass the parameter? Based on a condition?

    Jared
    CE - Microsoft

  • RE: How to Pass Optional parameters in SSIS

    Again, you're not giving me enough information. Please post the entire proc and describe in detail what you want to do with it.

    Jared
    CE - Microsoft

  • RE: Insert a record for every possible date within a range

    Like this?

    INSERT INTO #Backups

    ([CalendarDate], [ServerName], [DBName], [RecoveryModel], [IsTlogShipped])

    SELECT TOP

    (DATEDIFF(DAY,CONVERT(VARCHAR,@FirstBackupDate,102),GETDATE()) + 1) DATEADD(DAY,ROW_NUMBER() OVER (ORDER BY [CalendarDate]) -1, @FirstBackupDate) AS [CalendarDate]

    ,@ServerName

    ,@DBName

    ,'D'

    ,@IsTlogShipped

    FROM [dbo].[Calendar]

    UNION ALL

    INSERT INTO #Backups

    ([CalendarDate], [ServerName], [DBName], [RecoveryModel], [IsTlogShipped])

    SELECT TOP...

    Jared
    CE - Microsoft

  • RE: Insert a record for every possible date within a range

    What column is the 'D' or 'L' getting inserted to?

    Jared
    CE - Microsoft

  • RE: HTTP Error 404 when running reports URL after a fresh instal of a new instance of SSRS

    What url? If you can get access to http://server/reports, but not to actual reports... It is a different issue than not being able to get to http://server/reports.

    Jared
    CE - Microsoft

  • RE: If else outputting incorrectly

    Well don't leave us hanging! How did you solve the @@rowcount issue and what setting was disabled?

    Jared
    CE - Microsoft

  • RE: If else outputting incorrectly

    What happens if you run this?

    CREATE TABLE #temp1 (fghf int identity(1,1), something varchar(25))

    INSERT INTO #temp1

    SELECT 'dfsahjkfdh'

    UNION ALL

    SELECT 'fdsg'

    UNION ALL

    SELECT 'jtyhgkd'

    UNION ALL

    SELECT 'jgddgjdj'

    declare @table_id int

    declare @schema_name varchar(128)

    declare @table_name varchar(128)

    declare @str varchar(4000)

    declare...

    Jared
    CE - Microsoft

Viewing 15 posts - 661 through 675 (of 2,647 total)