Forum Replies Created

Viewing 15 posts - 241 through 255 (of 455 total)

  • RE: Retrieving Data From Two Different Databases

    You can use the following syntax

     

    SELECT a.*,b.*

    FROM dbo.currentdbtable a

    JOIN

    secondb..tablename b ON b.somecolumn = a.somecolumn.

     

    Please post your query, so that it would be more clear.

     

  • RE: update table question

    What Sriram has posted is for example for you to understand. You do the same practise of dumping your data to a table as you are currently doing and replace...

  • RE: Matrix Control

    Try copying the expression of rowgroup and pasting in the row section. I donot have RS handy on this system to try and confirm.

     

  • RE: INSERT - issue

    Make sure you are not using any of the above authentication users (dbo, dbcreator or sysadmin) as mentioned by Mike in your connection string for the application.

     

  • RE: Is it possible input anything by user.........

    Do you mean to say you must be able to enter Promotion code against each order in your report? I don't think its possible. Reporting only supports read only display...

  • RE: Violation of PRIMARY KEY constraint when used with temp table

    Include IF EXISTS DROP, CREATE statement when you are creating your temp table inside the script, however you should not really get the error on PK violation as the scope...

  • RE: Value from Query

    The output will be returned as MonthName as part of the resultset, do you want it to be printed?

     

  • RE: Count if condition

    I believe the closing brace after group by Practitioner is missing, PractitionerGroup is the derived table and the syntax should work without any errors.

     

  • RE: Value from Query

    CREATE PROCEDURE MyProc

    @Field VARCHAR(50)

    AS

    DECLARE @StrQry VARCHAR(1000)

    SET @StrQry = 'SELECT ' + @Field + ' FROM Customers WHERE     (City = ''Berlin'')'

    EXEC (@StrQry)

    GO

    EXEC MyProc 'CustomerID'

    GO

  • RE: Value from Query

    CREATE PROCEDURE MyProc

    @Month VARCHAR(12)

    AS

    DECLARE @Qry VARCHAR(1000)

    --SET @Month = 'July'

    SET @Qry = 'SELECT CASE ' + @Month +  ' WHEN 1 THEN ''ONE''

      ELSE ''TWO'' END AS MonthName

      

      FROM

       LockDatabase

      WHERE

       CompanyID=''BM''

      AND

      ...

  • RE: Transaction

    Transaction boundaries are required when you are trying to do multiple inserts and based on the output of the first insert if you are doing a second insert and if...

  • RE: Value from Query

    First of all why do you Numeric as datatype when you are saving INT value, you can have it a BIT or SMALLINT and from your post I believe you...

  • RE: Value from Query

    What is the Datatype error you are getting?

    SELECT  CASE MonthName

     WHEN

      1

     THEN

      'One'

     WHEN

      2

     THEN

      'Two'

     END As MonthName

    FROM

     LockDatabase

    WHERE

     CompanyID='BM'

    AND

     Finyear='2006-2007'

    AND

     MonthName = @Month

    Hope this helps...

     

  • RE: Parameter in Select Qry in Stored Procedure

    You mean to say, you save the LedgersID as Comma Separated values in the column or do you pass the comma separated values to SP through LedgersID. You are using...

  • RE: List of sleeping transaction

    select  spid,

              ecid,

              status,

              loginame=rtrim(loginame),

              hostname,

              dbname = case

              when dbid = 0 then null

              when dbid <> 0 then db_name(dbid)

              end

        ,     cmd

    from  master.dbo.sysprocesses

    WHERE Status ='sleeping'

Viewing 15 posts - 241 through 255 (of 455 total)