Forum Replies Created

Viewing 15 posts - 47,776 through 47,790 (of 49,571 total)

  • RE: On-line Reference Books for SQL DBA

    The inside SQL Server series are books, not online resources. They are very worth buying though.

  • RE: On-line Reference Books for SQL DBA

    The 2005 books online are excellent, and I strongly recommend the Inside SQL Server 2005 series, from Solid Quality Learning.

    First one (Storage engine) was written by Kalen Delaney

    Next 2 (T-SQL...

  • RE: different behavior in view between 2000 and 2005

    SQL 2005 ignores sorts in a view unless the number of rows is limited by a top statement.

    Views shouldn't have sorts in them. The sort should only be done on...

  • RE: SQL Table Naming Convention

    If you really want to drive a DBA insane...

    CREATE TABLE [[dbo.[[[.[,] (

    [.[,[,] INT,

    [Max([.[,[,)] VARCHAR(10)

    )

    GO

    SELECT [.[,[,], [Max([.[,[,)] FROM dbo.[[dbo.[[[.[,]

    Yes, it's valid.

  • RE: Many to Many joins,insert

    Looks good. The main problem now is that there's no way to tell which instructor taught which student.

    Perhaps, instead of the InstructorCourse table, have a table which stored the occurences...

  • RE: Update a table from select statement results

    Pleasure.

  • RE: Update a table from select statement results

    As an aside, why are you storing dates as strings instead of datetimes?

  • RE: Update a table from select statement results

    In that case, you need an insert statement, not an update.

    Insert puts new rows into a table, update modifies existing rows in the table.

    Insert into dbo.MetaEvents (MetaFYStamp, MetaPerStamp, MetaDateStamp)

    select cast([Fiscal...

  • RE: Update a table from select statement results

    How many rows are in MetaEvents?

    Also, there's no join between MetaEvents (the table you're updating) and calender (the table that the values are coming from)

    What determines which row...

  • RE: How to get distinct records

    Do you want the two records with the lowest dates, or all the records that have the minimum date in the table?

    If the first, try top. If the second...

    SELECT TheDate,...

  • RE: Check if temporary table exists or not?

    Arun T Jayapal (1/7/2008)


    if (object_id('tempdb..#tblTemp','u') > 0)

    print 'exists'

    else

    print 'not exists'

    ...its not compiling...:ermm:

    Looks fine, and runs fine for me. What's the error that you're getting?

  • RE: update statistics

    SELECT OBJECT_NAME(object_id), name FROM sys.stats

    will show you all the statistics that exist in the DB

    DBCC SHOW_STATISTICS ('Table name','Statistics Name')

    will give you the breakdown of the stats.

  • RE: Isnull function

    You should always specify column names in an insert. Otherwise if the structure of the table changes, you code breaks. Whether you explicitly state default values, or leave them out...

  • RE: Isnull function

    Generally I would recommend leaving the connection settings at their default values, unless you have a good reason to change them, and you know exactly what changing them will do.

  • RE: Many to Many joins,insert

    Nice DB. Beter than I've seen a lot of professionals do.

    Few points.

    Bigints everywhere. Are you expecting more than 2.1 billion students?

    The StudentCourseInstructor table looks misnamed. There's no reference to instructor...

Viewing 15 posts - 47,776 through 47,790 (of 49,571 total)