Forum Replies Created

Viewing 15 posts - 16 through 30 (of 43 total)

  • RE: Audting Only DDL in Sql Server 2000

    I would suggest using a tool like Lumigent Log Explorer or another third party tool to do this.

    If you have budgetary constraints, then you can set up a trace with...


    I feel the need - the need for speed

    CK Bhatia

  • RE: Problem with DELETE that uses subquery

    I agree with the previous post regarding the JOINS, but I try to avoid using LEFT JOINS when I can. Try this

    DELETE STUDENT

    FROM STUDENT s

    WHERE s.STUDENT_SID = 'SOME_VALUE'

    AND...


    I feel the need - the need for speed

    CK Bhatia

  • RE: Perform 2 Counts in one query

    If I have understood your issue correctly - then the following should work

    SELECT COUNT(*) AS MainCount,

     isnull((select count(*) from tbl_NSP_Answer AS A

       where Q.QuestionTreeUID = A.QuestionTreeUID

       and A.InspectionUID LIKE '00052_0000010890%'

      &nbsp


    I feel the need - the need for speed

    CK Bhatia

  • RE: Store images in database or webserver?

    The only thing I would like to add is that if you are going to store blobs in the database, you might want to store them on a seperate filegroup...


    I feel the need - the need for speed

    CK Bhatia

  • RE: how to parse a T-SQL script to get the tables touched by the query?

    This may sound too simplistic, but why not create the script as a dummy procedure and then do a "Display Dependencies..." on this procedure?

     


    I feel the need - the need for speed

    CK Bhatia

  • RE: Check for key violation before insert

    Assuming that the 4 columns in your joins are the PK of the target table, you can try this

    INSERT #TEMP_WEB_NOTES

    SELECT  WN1.CC025_ORG_CODE,

     WN1.CC025_EXT_ACCT_CODE,

     WN1.CC025_NOTE_CLASS,

     WN1.CC025_PROD_CODE,

     WN1.CC025_NOTE_TEXT,

     WN1.CC025_HTML_TEXT

    FROM #WEB_NOTE_1 WN1

    where not exists (select 1 from #TEMP_WEB_NOTES T

       WHERE...


    I feel the need - the need for speed

    CK Bhatia

  • RE: search all fields

    If you are going to search that many columns, and if your table has a large number of rows (millions) - then you might be better off using Dynamic SQL...


    I feel the need - the need for speed

    CK Bhatia

  • RE: Need to Pivot some data

    If the number of values for s1 is fixed (in your example - 3) - then you can use the following

    create table #temp (s1 tinyint, s2 tinyint, crit float)

    insert into...


    I feel the need - the need for speed

    CK Bhatia

  • RE: Non-clustered Index - Why the limit of 249

    Funny thing is that the indid column in sysindexes is defined as a smallint, thus they could have gone up to 32,767.

    I bet it has something to do with...


    I feel the need - the need for speed

    CK Bhatia

  • RE: DB Maintenance Plans and Repair DB Integrity Error

    I am not sure whether there is a way to do that within the Maintenance Plan, but you can do it using the following SQL statement.

    alter database <databaseName> set single_user...


    I feel the need - the need for speed

    CK Bhatia

  • RE: Use T-SQL to read backup filename from disk

    Ryan - My apologies. I guess I didnt read your entire post - I am known to be too excitable. Must be all...


    I feel the need - the need for speed

    CK Bhatia

  • RE: Don''''t blame SQL please....

    Sushila - Point noted - I should have worded it differently to read "you HAVE to use column aliasing for a calculated column or computed column when using "select ...into".

     


    I feel the need - the need for speed

    CK Bhatia

  • RE: Don''''t blame SQL please....

    I meant that you HAVE to use column aliasing, whether you use the AS keyword, or not. The AS keyword is optional - but you do have to provide a...


    I feel the need - the need for speed

    CK Bhatia

  • RE: Use T-SQL to read backup filename from disk

    You can use the following snippet of code

    CREATE TABLE #fileexist ([File Exists] int, [File is a Directory] int, [Parent Directory Exists] int)

    declare @fileName varchar(255)

    select @fileName = 'C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\pubs_db_'...


    I feel the need - the need for speed

    CK Bhatia

  • RE: Use T-SQL to read backup filename from disk

    Alternatively, you could use the following undocumented command

    exec master.dbo.xp_fileexist 'C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\pubs_db_20060419.bak2'

    which will give you the following output

    File Exists File is a Directory Parent Directory Exists

    ----------- ------------------- -----------------------...


    I feel the need - the need for speed

    CK Bhatia

Viewing 15 posts - 16 through 30 (of 43 total)