Forum Replies Created

Viewing 15 posts - 91 through 105 (of 123 total)

  • RE: select from all the tables in a DB

    This will give you a row count for every table.

    SELECT so.name, rowcnt

    FROM  sysobjects so

    JOIN  sysindexes si

    ON  so.id = si.id

    WHERE indid = 1

    AND  type = 'U'

  • RE: sp_add_jobstep

    I just figured it out.

    I added a variable: @sql varchar(100)

    Populated it with the value I wanted: @sql = 'EXEC TEST_abc_UserNameUpdate ' + @UserToFind + ', '...

  • RE: SELECT FROM @variable

    I just got it.  Thanks for your help!

  • RE: SELECT FROM @variable

    Thanks ED.  This is good if I am searching one column.  But I am searching many columns that may or not exist in each table.

    ...AND   sc.name IN ('AccessUserName', 'CancelledUserName', 'CancelUserName',...

  • RE: SELECT FROM @variable

    Got it!

    Thanks!!!

  • RE: SELECT FROM @variable

    I've tried that but the cursor is a variable and it doesn't work and thus this posting.

    DECLARE @ObjectName varchar(100) -- tried with and without this using ObjectCursor directly in the alternative

    DECLARE...

  • RE: SELECT FROM @variable

    I have a query that retrieves the table names where certain column names appear.  Something like this

    SELECT DISTINCT so.name

    FROM  syscolumns sc

    JOIN  sysobjects so

    ON  sc.id = so.id

    AND  sc.name IN ('AccessUserName'...

    So I then get a list of table...

  • RE: Count of Consecutive Values

    This is a Microsoft interview question...

  • RE: Results to txt file

    One way would be to send the results to yourself as text file.  First create a stored procedure for your query.  Then run

     EXEC master.dbo.xp_sendmail

      @recipients = 'youremailaddress'

      , @subject = 'Whatever'

      , @message =...

  • RE: Tracking Stored Procedures

    David.Poole,

    Could you provide sample code?  This is what I have currently added to the stored procedure:

    INSERT INTO Test

    (StoredProcedure, UserName, ComputerName, Application, RunDate)

    VALUES ('TESTasp_AddressDetail', SUSER_SNAME(), HOST_NAME(), APP_NAME (),  GETDATE())

    So naturally the...

  • RE: Tracking Stored Procedures

    What about server performance if profiler is running the trace continuously?

  • RE: Round to Even (aka Banker''''s Rounding) - The final function

    when do you guys work?

  • RE: Date Conversion

    You the man Jeff!!!!!!!!!!!!!

  • RE: Subqueries

    Tom,

    I ran both steps together and got the results in about 1 to 2 seconds!

  • RE: Subqueries

    Thanks everyone for your input.  These were all great suggestions.  They all work good and when comparing speed only, here are the results:

    The one I posted takes about 4 seconds

    JLK: 1...

Viewing 15 posts - 91 through 105 (of 123 total)