Forum Replies Created

Viewing 15 posts - 16 through 30 (of 89 total)

  • RE: Is there a way to search the database for a certain datatype?

    You cannot just change the type in syscolumns.  Even though you may only store integer data in a varchar column, the data is not stored the same way in the...

  • RE: need to remove a pipe in a part number

    You can use PATINDEX to find the location of the pipe and then use that in the substring function. 

  • RE: INSERT HELP??

    You are doing the query for multiple encounters, so won't you have multiple records in the #Sps table?  Do you just want the first record? Min/Max?

    You will need to set the...

  • RE: INSERT HELP??

    If I read your code correctly, you only insert into the #Log table if the #Sps table is empty.  If so, you don't have any values in the FirstEncDt or...

  • RE: Table size in DB

    Look at the code for sp_spaceused to get the exact.  But here is a quick, and fairly accurate way.

    SELECT so.Name, SUM(dpages)*8/1024. pagesMB, SUM(Reserved)*8/1024. reservedMB

    FROM sysobjects so, sysindexes si

    where so.type='u'

    and so.id=si.id

    group...

  • RE: Same Query Same Database Different Servers

    Are the dev and prod databases similar in size and data?  Did your prod query have an order by clause that you didn't include on the dev query?

    Brian

  • RE: how can i insert data from one server to another

    I would also suggest using the column list to guarantee the data is inserted properly.  Otherwise you can have problems if the columns are not in the same order, or...

  • RE: DTS Fails when scheduled

    If you use Windows Authentication for the database connections, you will use your login when you run it manually.  However, when you schedule it to run, it will use the...

  • RE: Problem using Top for Cursor

    So you want to set the RegionID value to the maximum empid for a given city?

    UPDATE e

    SET RegionID=t.EmpID

    FROM table_Employees e, (SELECT CityID, MAX(EmpID) EmpID FROM table_Employees GROUP BY CityID) t

    WHERE...

  • RE: Problem using Top for Cursor

    ROWCOUNT limits the number of rows a query will use.  ROWCOUNT n - n is the number of rows you want to return.  0 is unlimited. 

    SET ROWCOUNT 1

    SELECT *...

  • RE: Problem using Top for Cursor

    What is the DDL for table_employees and your procedure?  I would tend to think that EmpID would be unique for each record in table_Employees.  If so, why would you need...

  • RE: Search for percent signs using like query

    You only escape out the character if you are using LIKE.

    ='%'

    Brian

  • RE: Search for percent signs using like query

    Try

    Like '%[%]%'

    Brian

  • RE: Random lockups

    When did this start happening?  Does that coincide with changes in the application or in daily procedures?  Is this server "linked" to other SQL boxes?  If so, are there jobs...
  • RE: DTS works manually, but fails as a job

    I stand corrected.  Thanks Greg and Steve.  I should have my coffee before I start typing.

Viewing 15 posts - 16 through 30 (of 89 total)