Forum Replies Created

Viewing 15 posts - 1 through 15 (of 29 total)

  • RE: report manager problem

    Try opening http://localhost/reports from browser window in the server m/c. If that works in local machine and does not work from remote m/c, it should be to do...

  • RE: report manager problem

    Are you able to launch Report Manager in the server where you have installed SSRS?

    We had similar issues where we could launch it in server but not from our local...

  • RE: see the values passed to SP params internaly.

    As coding standards, we always have a @Debug bit parameter to all the stored procedures that defaults to 0. For App debugging, we can pass this as 1 from client...

  • RE: Help with T-SQL query

    Your requirement can be solved using a Numbers or Tally table.

    Refer to the below article on Numbers table and the final example has pointers for your requirement.

    http://qa.sqlservercentral.com/articles/T-SQL/62867/

  • RE: CREATING DYNAMIC TEMPORARY TABLE

    temp table created as part of dynamic query will not be visible outside the scope of the dynamic query. Try creating global temp table if that suits your purpose.

  • RE: Week Commencing Count

    The set option does the trick in the below code. Set it accordingly.

    Insert into #Ord (OrderId, DateEntered)

    Values(1, '2009-04-06')

    ,(2, '2009-04-06')

    ,(3, '2009-04-08')

    ,(4, '2009-04-10')

    ,(5, '2009-04-12')

    ,(6, '2009-04-13')

    ,(7, '2009-04-15')

    ,(8, '2009-04-16')

    SET DATEFIRST 1;

    SELECT FirstDayOfWeek, COUNT(*)

    FROM (

    SELECT...

  • RE: display selected pivot data

    Note: This is not a generic solution. Adjust the order by clause of rank to get the desired result

    SELECT personid, MAX(company) AS company1, MIN (company) as company2

    FROM (

    SELECT RANK() OVER(PARTITION...

  • RE: Pivot tha data in this format

    Use the above query as a subquery and do the conversion in the outer query.

    -Arun

  • RE: Pivot tha data in this format

    using a cross join

    SELECTa.Type, c.MonthYear,

    Sum(CASE WHEN c.MonthYear='jan-2008' THEN a.[jan-2008]

    WHEN c.MonthYear='feb-2008' THEN a.[feb-2008]

    WHEN c.MonthYear='mar-2008' THEN a.[mar-2008]

    END) Amount

    FROM forecast a

    CROSS JOIN (SELECT 'jan-2008' as MonthYear...

  • RE: Pivot tha data in this format

    Create table forecast (

    typevarchar(10),

    [jan-2008]int,

    [feb-2008]int,

    [mar-2008]int )

    Insert into forecast values ('Actual', 100, 200, 300)

    Insert into forecast values ('Budget', 200, 500, 800)

    Select* from forecast

    SELECT *

    FROMforecast

    UNPIVOT (Amount FOR MonthYear IN ([jan-2008],[feb-2008],[mar-2008] )) AS...

  • RE: Counting days with and without an end date

    Is it not simple as below. Please state your requirement otherwise

    SELECT callnbr,entdte,compdte,

    CASE compdte

    WHEN '1900-01-01 00:00:00.000' THEN DATEDIFF(day, entdte, getdate())

    ELSE DATEDIFF(day, entdte, compdte)

    End AS Workdays

    FROM svc00200

  • RE: selecting query at run time

    You can also use the below to get user name in sql queries.

    SELECT SYSTEM_USER

  • RE: Find sp in server

    Try this

    Exec sp_MSForEachDB 'SELECT ''?'' AS DataBaseName, * FROM ?..sysObjects WHERE name = ''sp_FindDetails'''

  • RE: Database Connectionstring as a variable

    Create 2 variables for ServerName and DatabaseName and use them in the property expression to form the connection string as below.

    "Data Source="+ @[User::ServerName] +";Initial Catalog="+ @[User::DatabaseName] +";Provider=SQLNCLI.1;Integrated Security=SSPI;"

Viewing 15 posts - 1 through 15 (of 29 total)