Forum Replies Created

Viewing 15 posts - 1 through 15 (of 79 total)

  • RE: Temp table usage in dynamic sql

    Yes, a global temp table is an option. Just have to remember the concurrency issue - can't have multiple processes executing the code concurrently, or have different code using the...

  • RE: Temp table usage in dynamic sql

    sowmya.br (12/16/2008)


    Everything is fine in the SP which seth has given

    Only thing is i donot want to create #a like below

    CREATE TABLE #a(

    ...

  • RE: Trying to pull last 3 transactions

    Use "left join" instead of "inner join" on the derived tables.

  • RE: Linked server connection problem

    How are you executing your simple TSQL to get the error? In an SSMS query window? I've seen this error when executing from a SQL Agent job because the SQL...

  • RE: Adding a new column in 320 table

    select eno,DOB,Salary

    from emp

    where dt_log > '01/01/2008'

    The query will not make use of an index on (eno, DOB, dt_log). Try it.

    Perhaps you want to add to every table a new index...

  • RE: Concatenation of multiple records

    I read that functions cannot return text datatype, at least in sql2000.

  • RE: Trying to pull last 3 transactions

    It's not particularly simple to do that stuff. But here's a sample you can work with.

    -- sample table and data.

    declare @tbl table (id int, trans_desc varchar(20), trans_date datetime, trans_id...

  • RE: Concatenation of multiple records

    The text datatype means this must be done procedurally, i.e. in a loop of some kind.

    I'm not sure, but something like this may be more efficient outside of SQL...

  • RE: Concatenation of multiple records

    What is the max that will be concatenated, i.e. the destination column datatype? char(8000), varchar(max), text?

    What version of SQL Server? SQL2005 and SQL2008 have more features related to this task.

  • RE: Trying to pull last 3 transactions

    What version of SQL Server? SQL2005+ has some new stuff that helps will these kind of queries.

  • RE: Trying to pull last 3 transactions

    I generally use TOP to do something like that. For example:

    SELECT TOP 3

    id,

    desc,

    trans_date

    FROM

    ...

  • RE: Event Calendar Grid

    I see what you're doing, David.

  • The FROM clause uses #weeks and #nums to generate the maximum possible number of rows for all the weeks.
  • The WHERE clause uses a...

  • RE: Dynamic Query output into Cursor

    David's answer works because he's using an old-fashioned cursor not a cursor variable. The old-fashioned cursors have a scope of the entire session; they don't go away until you deallocate...

  • RE: Stored Procedure Output Parameter as input?

    All params are at least input params. The value of the param is passed from the calling routine into the stored procedure.

    Only those with the OUTPUT flag are output params....

  • RE: picking the "best" row out of a set

    Using TOP with ORDER BY is a great idea. So simple.

    However, I simplified my situation a little too much. There are actually other columns that govern the sort order...

  • Viewing 15 posts - 1 through 15 (of 79 total)