Forum Replies Created

Viewing 15 posts - 211 through 225 (of 430 total)

  • RE: Running an app on another box

    If the procedure that moniters the application can restart the job use it.

    Or Use a windows service locally to execute the batch file.

  • RE: SELECT from multiple tables

    Add the new table like

    SELECT DRid, DRtagNumber, DSnameLast, DSnameFirst, DRclaimNumber, CMclientName

    FROM

     SCHOOLNET.dbo.dmvrequest

    LEFT OUTER JOIN

     SCHOOLNET.dbo.clientmaster

    ON clientmaster.KeyField = dmvrequest.KeyField

    LEFT OUTER JOIN

     SCHOOLNET.dbo.dmvsubject

    ON DRdmvSubjectID = DSid

     

  • RE: how to use the return values of two functions in a select statement

    I would assume Ray's answer will work.

    or--------------------------

    Create a new function cobining these two functions

    create function test3(@idnumber varchar(27), @rangestart1 datetime, @rangeend1 datetime,@rangestart2 datetime, @rangeend2 datetime)

    returns int

    as

    begin

    declare @intdays as int

    select @intdays =...

  • RE: Pivot table

    Query will look like

    SELECT

     [1-10] = SUM(CASE WHEN EmployeeSize BETWEEN 1 AND 10 THEN 1 ELSE 0 END),

     [11-20] = SUM(CASE WHEN EmployeeSize BETWEEN 11 AND 20 THEN 1 ELSE 0...

  • RE: Pivot table

    With 1000 columns the query will be huge. May be this will give you an idea how to build the query.

    SET NOCOUNT ON

    /* GET DATA INTO TEMP TABLE START */

    CREATE...

  • RE: Edit Server Registration Properties

    Most of the functions in EM are done by some sytem stored procedures. Run SQL - Trace. Do your modifications in EM. You will find the command in the trace.

    If you...

  • RE: Edit Server Registration Properties

    You can check & change logon and user properties using system stored procedures like

    sp_addlogin

    sp_adduser

    sp_helplogins

    sp_change_users_login

    sp_dropuser

    sp_helpuser

  • RE: I can''''t get this update correct.

    /* If this doesn't work please post the data in your table as below */

    DECLARE @BL_TRUCK_BOL_DEST TABLE

    (

    bol_no  VARCHAR(12),

    dest_bol_no VARCHAR(12),

    rev_no  INT,

    max_rev_yorn VARCHAR(1) NULL

    )

    INSERT INTO @BL_TRUCK_BOL_DEST VALUES ('000001', '000002BT', 1, NULL)

    INSERT INTO @BL_TRUCK_BOL_DEST VALUES ('000001',...

  • RE: Excel Export

    SQL will not insert a single quate infront of a value.

    When we have Excel cell format a general and the value is numeric (Varchar field) excel will take that...

  • RE: I can''''t get this update correct.

    try this

    UPDATE A

    SET

     max_rev_yorn = 'Y'

    FROM

     BL_TRUCK_BOL_DEST A

    JOIN

     (SELECT bol_no, MAX(rev_no) rev_no FROM BL_TRUCK_BOL_DEST

       WHERE bol_no = '000001' GROUP BY bol_no) B

    ON

     A.bol_no = B.bol_no AND

     A.rev_no = B.rev_no

    or

    UPDATE A

    SET

     max_rev_yorn = 'Y'

    FROM

     BL_TRUCK_BOL_DEST A

    JOIN

     (SELECT...

  • RE: I can''''t get this update correct.

    /* Your Select */

    SELECT  dest_bol_no,

     rev_no,

     max_rev_yorn

    FROM

     BL_TRUCK_BOL_DEST A

    JOIN

     (SELECT bol_no, MAX(rev_no) rev_no FROM BL_TRUCK_BOL_DEST B

       WHERE A.dest_bol_no = B.dest_bol_no GROUP BY bol_no) B

    ON

     A.bol_no = B.bol_no AND

     A.rev_no = B.rev_no

     

    /* Your Update */

    UPDATE A

    SET

     max_rev_yorn...

  • RE: Multiple inserts

    If you are using ASP.net keep everything in ViewState. If the application user has Insert rights on the tables just use Data Adapters's Isnsert/Update command. It  will take care of...

  • RE: date

    SET NOCOUNT ON

    DECLARE @CTR INT

    SET @CTR = 100

    WHILE @CTR < 125

    BEGIN

    SELECT CONVERT(VARCHAR(10), GETDATE(), @CTR) [DATEFORMAT], @CTR

    SET @CTR = @CTR + 1

    END

    or

    Do you want datepart

    SELECT DATEPART(DD, GETDATE())

    SELECT DATEPART(D, GETDATE())

    SELECT...

  • RE: Monthly Report

    Noel gave me an answer to one of my queries once. I tweeked it a liitle got the answer. Thanks Noel.

    SELECT Code,

     DAY1 = SUM(CASE WHEN DATEPART(DAY, InstallDate) = 1 THEN InstallCounts...

Viewing 15 posts - 211 through 225 (of 430 total)