Forum Replies Created

Viewing 15 posts - 436 through 450 (of 1,346 total)

  • RE: Query

    Fine,

    Can you post a table definition, some sample data, and what you want as an expected result.

     

    Thx

  • RE: Query

    What?

    Of course you can have multiple items in the where clause, Unfortunatelly I wasn't paying attention when I posted

    Try this.

    If Exists(select substring(Col001,1,2)from Emp where substring(Col001,17,2)='DH' And substring(Col001,17,2) not in...

  • RE: Syntax error converting datetime from character string.

    Try This.

    Select substring(cast(Processos.Dataabertura as char),1 , 12)+substring(cast(processos.horaabertura as char),1, 5) as date1,

    substring(cast(cabecinterv.Datafim as char),1 , 12)+substring(cast(cabecinterv.horafim as char),1, 5) as Date2

     FROM Cabecinterv, Processos WHERE (Cabecinterv.Processo=Processos.Processo)

     AND ((NOT Processos.Fechado=0) AND Cabecinterv.Estado...

  • RE: Query

    Your missing something

    If Exists(select substring(Col001,1,2)from Emp where substring(Col001,17,2)='DH' And substring(Col001,17,2)='DH' not in (@per))

    But is easier to read if

    If Exists(select * from Emp where substring(Col001,17,2)='DH' And substring(Col001,17,2)='DH' <> @per)

  • RE: dynamic SQL & triggers

    IMO A trigger is the worst place.

    It holds your transaction open until the copy to the other server is complete. So the question would be what happens of one of...

  • RE: Dynamic Search stored procedure

    -- Comments Added

    ALTER        PROCEDURE dbo.test2 

    @quiz nVARCHAR( 25 ),

    @debug     bit  = 0

    as

    DECLARE @sql        nvarchar(4000),                           

            @paramlist  nvarchar(4000)                                

    begin                                                                  

    CREATE TABLE #tmpTrained(

    EmplID char(30))

    set @sql='select distinct EmplNO from tblCurrentWinTrainingLog where  1=1'

    set @sql=...

  • RE: Syntax error converting datetime from character string.

    First I would recommend you explicitly specify the length of your cast.

    cast(Processos.Dataabertura as char(12)

    But also just execute this

    Select substring(cast(Processos.Dataabertura as char),1 , 12)+substring(cast(processos.horaabertura as char),1, 5) as date1,

    substring(cast(cabecinterv.Datafim as char),1...

  • RE: capture start/end datetime, user name and stored procedure name

    For sql server you would use the SQL Profiler Tool

    it is fairly robust in terms of capturing events on the server.

    Heres a quick read

    http://www.developer.com/db/article.php/3482216

  • RE: Declare or set column names

    Why would you want to do that?

    Here is a must read if your thinking of going down this road.

    http://www.sommarskog.se/dynamic_sql.html

  • RE: SELECT Columns without using column names

    Not without dynamic sql.

    using exec sp_executesql, or EXEC()

    If you have not read, here is a great page concerning dynamic sql.

    http://www.sommarskog.se/dynamic_sql.html

    I am not an advocate of using dynamic sql to...

  • RE: Alternative to using DISTINCT with COUNT Function

    Can U do Derived Table

    Select count(*)

    From (select distinct QuestionTreeUID FROM tbl_NSP_Answer) T

  • RE: Select Unique Foreign Key Rows

    Select *

    From Forum_Child

    join (Select max(ID) as LastID, PID

          From Forum_Child

          Group by PID) T on LastID = ID

  • RE: Stored procedures debugging

    Yes,

     

    In QA Open the Object browser

    Tools --> Object Browser --> Show/Hide.

    Locate the stored procedure in db you want, Rightclick, Select Debug.

    Enter parameters if required.

    Not perfect, but works

  • RE: Can this function be Tuned

    That function looks fairly straightforward, and by itself  I bet it runs fine.

     

    My guess is how your using it in your select statement.

    Can you post that too?

  • RE: Home page

    Thats the rub, You really can't.

     

    you can create your own page in .NET, and call the report via URL Access and drop the report in a reporting services "Control"

     

Viewing 15 posts - 436 through 450 (of 1,346 total)