Forum Replies Created

Viewing 15 posts - 871 through 885 (of 1,315 total)

  • RE: Dynamic SQL - Function

    Use the full syntax for sp_executesql to pass parameters in and out.

    declare @z varchar(150)

    exec

    sp_executesql

  • RE: Summarize same column with different WHERE clause

    SELECT

    Sales, Profit,

        SUM(CASE WHEN <condition1>...

  • RE: Creating Job in Enterprise Mgr using TSQL code

    The command text of a job step is limited to 3200 chars.

    [@command =] 'command'

    Is the command(s) to be executed by SQLServerAgent service through subsystem. command is nvarchar(3200), with...

  • RE: Question: Trying to set up Maintenance Plan through T-SQL

    The sqlmaint.exe utility and the msdb tables that support SQL 2000 maintenance plans are going away.  SQL 2005 includes the stored procs you mention, but the tables are there only if SQL...

  • RE: SQL 2005 32bit/64bit mixed environment questions

    I was suggesting that the SQL server create some kind of artifact, such as text, log, or XML file, in a share visible to a unix/linux box.  The "sendmail" I...

  • RE: New Laptop - How 2 Copy Registerations?

    You could use Visual Basic, or even VBScript.  You can even use sp_OAxxx procedures to access SQLDMO objects in T-SQL.

    This script may be of some use.  It won't export existing registrations, but you...

  • RE: New Laptop - How 2 Copy Registerations?

    If you install the SQL 2005 client tools (which support your 7.0 and 2000 servers), you can import your existing registrations in Management Studio and then export them to an XML...

  • RE: Finding Gaps in a Sequential Number Sequence

    I agree, the join on "where Seq2.SeqNumber < Seq1.SeqNumber" will be a killer with large tables.

    This version...

  • RE: SQL Mail on isolated server

    That would involve an illegal connection to the monitored server.

    If you could find a Unix geek that was frozen in a glacier 20 some years ago with his 286 Xenix...

  • RE: Join with where clause?

    Don't look now, but your "where c.val = 8" just turned all the left joins into inner joins.

  • RE: Average of time

    That's a great solution if one of your goals is job security, but unfortunately it gives you the wrong answer.

    You implied it was a datetime field originally, not character.  If...

  • RE: Join with where clause?

    You can use the WHERE clause with INNER JOIN with no problems:

    SELECT <fields>

    FROM a INNER JOIN b ON a.id = b.id

    WHERE a.x > 0 AND b.x > 0

    If you want...

  • RE: Insert only records that do not yet exist

    If you used a unique index rather than a primary key or unique constraint, you could use the IGNORE_DUP_KEY option.  Insert all the rows you like, and the duplicates will...

  • RE: Average of time

    That will only average the date part.  If you want to average durations (time values), you need to do something different.

    select avg(cast(date_field as float))  -- Get average date & time

    select...

  • RE: DB engine green/red status not displaying

    Did you create new registrations in SMS, or use "Previously Registered Servers" to pull in old EM definitions?

    I haven't found the old "Display SQL Server state in console" option in...

Viewing 15 posts - 871 through 885 (of 1,315 total)