Forum Replies Created

Viewing 15 posts - 26,371 through 26,385 (of 26,487 total)

  • RE: Stupid query question...

    The only stupid question is the question not asked.

    Try this and see if it gives you what you are looking for:

    SELECT -- TOP 1

        startdate,

        starttime,

        page,

        pageid

    FROM

        dbo.Page_History pgh1

    WHERE

       ...

  • RE: SET IDENTITY_INSERT tblXXX ON

    The problem is the nature af dynamic sql.  You need to add the set identity insert on in the same dynamic sql that does the insert:

    CREATE PROCEDURE cspAPP_CreateInvSnapShotTable

      @dt_Date Datetime

    AS

    declare ...

  • RE: dynamic sql quotations

    Try this:

    select @cmd = 'use ' + @dbname + '; declare @uid int, @cmd varchar(500), @name sysname ' +

           'if exists (select * from dbo.sysusers where sid = suser_sid('''...

  • RE: dynamic sql quotations

    Sorry, missed the begin further inside the code.  I am reformatting your code to see what else may be going on.

     

  • RE: dynamic sql quotations

    Not really sure, but have you tried leaving off the the concatenation of 'END' from your dynamic sql?

  • RE: Group by and total of the resultant records

    Change your GROUP BY to this: GROUP BY dept_no WITH ROLLUP

    It just won't say total under deptX

     

  • RE: One to Many, update the One

    Without knowing the structure of your tables or the data contained, a little difficult to help come up with the solution you are looking for, however, I hope the following...

  • RE: NEED URGENT HELP error while excecuting a transaction involving two servers

    As you do not update anything on the other server inside the transaction, can you pull the information you need from the other server outside the transaction, then do the...

  • RE: NEED URGENT HELP error while excecuting a transaction involving two servers

    Two questions need to be answered first before I can try to offer some help.  First, are you attempting to update any data on the other server where your view...

  • RE: Results showed in a new way

    I turned to dynamic sql, but I got a possible solution.  There may be other ways to do this, but I will leave that to the SQLServerCentral community to find...

  • RE: Results showed in a new way

    This is where your knowledge of the data is important.  Are all the possible registers known in advance, or are each of them an unknown until there is an entry...

  • RE: Results showed in a new way

    Here is one way, but it requires you know the data to setup the query:

    declare @testtbl table (

        Material    varchar(10),

        Client      varchar(10),

        Files       smallint

    )

    insert into @testtbl values('Paper','Alex',123)

    insert into @testtbl values('Paper','Gilbert',322)

    insert...

  • RE: Error doing restore of full/differential backup

    Yes, each differential backup gets stored to its own file.  These files are backed up to tape nightly.  My transaction log backups get appended to the same file for each...

  • RE: No Performance gain with Indexed view ?

    Opps.  Forgot a few changes to the second query.  Here is a corrected version of the second one:

    SELECT

        cm.CustomerCode,

        cm.CustomerName,

        dca.Street1,

        dca.Street2,

        dca.City,

        dca.State,

        dca.Country,

       ...

  • RE: No Performance gain with Indexed view ?

    If the query above doesn't work, here is another one to try:

    SELECT

        cm.CustomerCode,

        cm.CustomerName,

        ca.StreetAddress1,

        ca.StreetAddress2,

        ct.CityName as City,

        st.LongName as State,

        cn.LongName as Country,

        ca.Zipcode,

        ca.Phone1 as Phone,

        ca.Fax,

       ...

Viewing 15 posts - 26,371 through 26,385 (of 26,487 total)