Forum Replies Created

Viewing 15 posts - 421 through 435 (of 907 total)

  • RE: Forcing SQL Server Agent to Fail

    Yes this is true a basic TSQL type step will fail when a bogus command is issues. My problem is I have a script I run. The script...

    Gregory A. Larsen, MVP

  • RE: Forcing SQL Server Agent to Fail

    You might be right on the updating of a running job, I'm not sure have not tried. Ok, I tested this, and turns out you can update a running job,...

    Gregory A. Larsen, MVP

  • RE: disable xp_sendmail

    What about using xp_stopmail when exchange is down, then xp_startmail when exchange is up?

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

  • RE: Adhoc TSQL via Web - Avoiding SQL Injection

    We where thinking the same on the SELECT only. Good thoughts here. I was kind of hoping of not having to re-invent (write) the wheel (code) that handles...

    Gregory A. Larsen, MVP

  • RE: CPU % from SQL

    You might try something like this to calculate something close to CPU Busy:

    declare @d1 datetime

    declare @d2 datetime

    declare @CPU1 int

    declare @CPU2 int

    select @CPU1 = @@CPU_BUSY, @d1 = getdate()

    while datediff(ss,@d1,getdate()) < 1

    ...

    Gregory A. Larsen, MVP

  • RE: Column Search in a database

    Try something like this. This will give you all the tables, and/or views that the column is used in.

    select table_name from information_schema.columns where column_name = 'mycolumn'

    Gregory Larsen, DBA

    If you...

    Gregory A. Larsen, MVP

  • RE: Where Did the Index Go???

    This script ran fine on my SQL 2K machine:

    create table c (c int)

    go

    CREATE INDEX #c

    ON test.dbo.c

    (c)

    GO

    sp_helpindex c

    go

    drop index c.#c

    go

    sp_helpindex c

    go

    drop table c

    [/quote]

    Gregory Larsen, DBA

    If you looking for SQL Server...

    Gregory A. Larsen, MVP

  • RE: Looking for useful scripts to aid development

    You might want to change 'LHJ_Hardware_PDA' to 'tblDataProvider' in my example.

    I hate when I do that.

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website...

    Gregory A. Larsen, MVP

  • RE: Looking for useful scripts to aid development

    Chris, I think you made this script far more complicated then it needs to be.

    Here are two possible examples to do the same thing:

    -- example one

    set nocount on

    select column_name +...

    Gregory A. Larsen, MVP

  • RE: How to have a line number without cursor

    Here is another way to set a row number:

    use northwind

    go

    select count(*) row_num, a.customerid,a.employeeid from

    (select customerid, employeeid from Northwind.dbo.orders group by customerid,employeeid) a,

    (select customerid, employeeid from Northwind.dbo.orders...

    Gregory A. Larsen, MVP

  • RE: Cross Tab type query

    What you want is to perform a pivot table. Here are some examples:

    http://www.geocities.com/sqlserverexamples/#pivot1

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

  • RE: Beware of Mixing Collations - Part 1

    TEMPDB table do present problem in a mixed collation environment. The TEMPDB takes on the collation of the MSDB database every time the server is restarted. One option...

    Gregory A. Larsen, MVP

  • RE: Beware of Mixing Collations - Part 1

    TEMPDB table do present problem in a mixed collation environment. The TEMPDB takes on the collation of the MSDB database every time the server is restarted. One option...

    Gregory A. Larsen, MVP

  • RE: SQL Server Drive setup

    If you can live with your server crashing if one log drive goes bad. I would not put the TLOG on RAID0.

    Also if you don't have transactions then why...

    Gregory A. Larsen, MVP

  • RE: row count for tables in DB

    Here is a script that gives you record counts for every table in every database on a server.

    http://www.sqlservercentral.com/scripts/contributions/341.asp

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website...

    Gregory A. Larsen, MVP

Viewing 15 posts - 421 through 435 (of 907 total)