Forum Replies Created

Viewing 15 posts - 196 through 210 (of 212 total)

  • RE: how to Delete old data from an excel file through DTS

    Whenever I have had to do this sort of thing, I have always used an empty template of the excel workbook (often there are macros or other worksheets which have...

  • RE: Possible to Fail a job step via ExecuteSQLTask???

    Yes:

     

    if exists (

    select filename

    from tableA

    where Filename = 'SomeFile') begin

     

    raiserror('File found', 16, 1)

    end

     

    J

  • RE: Stored Proc Optimization Help

    If you generate the execution plan (paste the code into Query Analyser and press CTRL-L or select Query and then Display Estimated Execution plan on the menu), it will tell...

  • RE: Output to file and then Bulk Insert problems/questions

    A better way would be to use a function to separate the text column by the delimeter so that you can avoid exporting directly.

    CREATE FUNCTION dbo.FAQ_ListToSingleColumn

    (

        @cslist VARCHAR(8000)...

  • RE: Return the most recent row

    One way of doing this is as follows:

    SELECT id, resulted_test_desc, result_value, units, update_date

    FROM dbo.lab_result LEFT OUTER JOIN

    dbo.mpi ON dbo.lab_result.blind_key = dbo.mpi.chart LEFT OUTER JOIN

    dbo.mpi_xref ON dbo.mpi.chart = dbo.mpi_xref.blind_key

    WHERE resulted_test_desc =...

  • RE: Add quotes around every value

    So why don't you convert the list of values from your application into a table and then use this through an inner join?

    See http://databases.aspfaq.com/database/how-do-i-simulate-an-array-inside-a-stored-procedure.html for details - my preference would...

  • RE: return 0 when count=null

    You will have to use a left outer join to ensure that you get all the categories from FDIS_CLAIM:

     

    SELECT distinct

    substring (fdis_claim.claimset_id, 1,8) as "DATE",

    CASE

     when substring (fdis_claim.claimset_id, 1,8) =...

  • RE: activeX script help...beginner

    I guess that if you connect to the TRANSROM server through Query Analyser you have no problems accessing the source table?

    If so, then I can only imagine that there is...

  • RE: activeX script help...beginner

    I'm not exactly sure.

    I think you can connect to an ODBC database within ActiveX which would allow you to execute queries (check exists, update or insert). 

    Alternatively, you could have...

  • RE: activeX script help...beginner

    If you use 3 level naming (database.owner.tablename) then it will not be a problem which connection you use.  If the tables are on different servers or instances on the same...

  • RE: activeX script help...beginner

    Personally I would not do the upsert (update/insert) in ActiveX because it is row by row processing and you may have performance problems.

    A better solution, IMHO, would be to load the...

  • RE: making tasks run parrallel in DTS?

    What you will need to do is to create one server connection per task - if you want to run 4 tasks in parallel you will need 4 separate connections...

  • RE: BCP across systems

    Why not use BULK INSERT? It is essetially BCP but runs as T-SQL so you would not be running a script - just a 'normal' SQL statement.

     

    J

  • RE: SELECT *

    Just be aware that when the procedures compile, SQL Server will resolve the SELECT * into column names.  This means that if you change the underlying view (not saying that...

  • RE: Random dates and times

    One way would be to calculate the difference between the two datetime values in seconds and mutliply this by an random number and add the result to the first datetime...

Viewing 15 posts - 196 through 210 (of 212 total)