Forum Replies Created

Viewing 15 posts - 61 through 75 (of 89 total)

  • RE: using IN operator in a stored procedure

    Another option is to dynamically build the sql statement.

    declare @sql varchar(2000)

    set @sql='select * from tbl where id in (' + @idlist +')'

    EXEC (@sql)

    If the ids are...

  • RE: SP Dynamic results in TempTable

    You can create the temp table outside of the procedure with the columns that are consistent between the two(or more) versions of the table.  Then in the sp_magic procedure, you can...

  • RE: Check for existing column of a table

    After the execution of the procedure, you can check @@ROWCOUNT

    EXEC sp_columns @table_name='X', @column_name='YY'

    IF @@ROWCOUNT>0

    BEGIN

    Insert code here

    END

     

    Brian

  • RE: SQL Server behaving strange. Help !!!!!!!!

    I would first run SP_Who2 and see if a specific spid is using all of the CPU and memory. If one spid is clogging the system, then you can...

  • RE: Re: SQLAgentmail

    When you say the account works in Outlook, are you logged in with the same domain account as SQL? In Outlook, are you seeing the message bounce back as...

  • RE: SQL Server behaving strange. Help !!!!!!!!

    Have you tried running profiler to see what queries are running? Are any of those queries running over and over(infinite loop). You may also get some clues from...

  • RE: Call stored procedure from stored procedure

    Do you want to use one procedure to build a recordset that can then be used in a second procedure? If so, create the temp table before executing the...

  • RE: Faster way to delete?

    You could also try to move the records you want to keep into a temp table, truncate the real table, and then move the records back from the temp table.

    select...

  • RE: Using TOP

    If you use SET ROWCOUNT @variable, make sure you SET ROWCOUNT 0 after your query.

    Brian

  • RE: QOD 21 Nov

    I too answered incorrectly. Looking at the wording of the question("which of the following could be done") means both answers can be correct.

    The fact the query runs every second...

  • RE: grouping not grouping right(maybe?)

    There are 4 distinct combinations of intLandUseCode and intMixedLandUseCode.

    intLandUseCode intMixedLandUseCode

    -------------- -------------------

    1 0

    1 ...

  • RE: Updating a table

    Can you submit examples of the table structures and your views and update statements. Is there a reason you can't use a case statement in the update? Then...

  • RE: Help: Ways of persisting the resultset from SP?

    You can select the results of the procedure into a global temp table.

    create proc #temp as

    select *

    into ##so

    from sysobjects

    go

    I can then

    exec #temp

    select * from ##so

    drop table ##so

    Brian

  • RE: Query Analyzer Replacement

    Thanks to all for your replies.

    I understand the ability to setup security within our systems. All of our users are to login with a read only user....

  • RE: Returning recordset that replaces a null record

    ISNULL will only return a second value if the first is NULL. If you need to expand on this, you will want to use COALESCE. It will return...

Viewing 15 posts - 61 through 75 (of 89 total)