Forum Replies Created

Viewing 15 posts - 121 through 135 (of 596 total)

  • RE: connect to an instance of sql server 2000 on server

    There are two types of login id's in SQL Server - Windows login id's and SQL Server login id's.

    A Windows login id is mapped to an operating system...

  • RE: Help With Date/Time Query

    Just change the last line to:

    set @minutes = DateDiff(mi, @start, @end)

  • RE: text file with inserts and updates

    Another option would be to create a batch file that runs osql.exe.

    The batch file would accept the name SQL file as a commandline parameter.

  • RE: How to know when a field has been modified in the table

    Forget the timestamp column - that does not give you the date and time when the modification occurred. It is used to indicate IF a row has been modified during...

  • RE: Search for string occurrence

    Here's some quick and dirty code that will just print out the object name. Sorry, but I used a cursor. Since I'm assuming this is for an ad-hoc administration task,...

  • RE: Search for string occurrence

    The [text] column in syscomments is nvarchar(4000). If the length of the text for the object is greater that 4000, it will be split into two or more rows. Be...

  • RE: Should be easy join but I don''''t see it

    If I understand you correctly, Pw was on the right track, except that you've already summed [column 17] in the subquery for each distinct [Column 0], so just include o.PTO_Sum...

  • RE: converting numeric fields to datetime

    There are many ways to accomplish that. Here's one way:

    -- First case

    SELECT numdate

    , CASE numdate

    WHEN 0 THEN NULL

    ELSE CONVERT(datetime, CONVERT(varchar(8), ((1900 + ((numField /...

  • RE: SPROC Problem

    If you mean that the five parameters are compare to an associated column in a table, there are a couple of things you could do, depending on your situation.  For...

  • RE: Subquery on iinsert

    What are the data types of the variables and columns? I retested the query using all int datatypes without any problems.  It worked perfectly.

     

  • RE: Subquery on iinsert

    INSERT INTO [dbo].[mytable]

         ( [CustomerEmail]

          ,[CapNo]

          ,[ImageNo]

          ,[Graphic])

      SELECT @CustomerEmail

            ,@CapNo

            ,(SELECT IsNull(Max(imageno),0)+1

                FROM [dbo].[mytable]

               WHERE customeremail = @CustomerEmail

                 AND capno = @CapNo

             )

            ,@Graphic

  • RE: Get Account Number using MIN - Multiple Users on System

    Actaully, each user gets a different #TempQueue1.

    The name #TempQueue1 is a local reference to an actual table name that is much longer in length, and is unique.

    However, why not try...

  • RE: New line Character in column alias

    Here's another (but similar) way:

    1. Put the SQL code in a stored procedure

    2. Run osql

    CREATE PROCEDURE uspCustFileOutput

    AS

    DECLARE @cust TABLE

    (

      cust_id int

    , cust_name varchar(30)

    )

    SET NOCOUNT...

  • RE: Cursor not returning data

    Inside the loop that processes close_cursor, there are two stored procedure calls:

    EXEC dbo.usp_Close_Open_Item @LOI_Open_Item_Amt, @LOI_Lease_Open_Item_Id, 0

    EXEC dbo.usp_Close_Open_Item @LOI_Open_Item_Amt, @LOI_Lease_Open_Item_Id, @SD_CRCCPP

    Do either of those stored procedures use cursors? As Lowell mentioned,...

Viewing 15 posts - 121 through 135 (of 596 total)