Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: sneki
  • Order by date
  1. sneki

    Problems with Transaction Log

    If you don't need your tr.log (do backup if you have free disk space), just remove it: 1. detach database 2. delete transaction log 3. attach database
  2. sneki

    Find Duplicate

    select mainid, productid from table group by mainid, productid having count(*) > 1
  3. sneki

    Getting the result set from a stored procedure

    Don't use stored procedure, use Multistatement table-valued functions or Inline table-valued functions(I think, you need Multistatement...). You can read about user-defined functions in BOL.
  4. sneki

    disabling trigger

    no, no :))
  5. sneki

    disabling trigger

    -- Disable the trigger. ALTER TABLE tableName DISABLE TRIGGER triggerName . . . code . . . -- Re-enable the trigger. ALTER TABLE tableName ENABLE TRIGGER triggerName
  6. sneki

    convert columns to Rows

    --set dateformat dmy select distinct school, (select lost from tableName t2 where t2.school = t1.school and t2.[date] = '20/10/2003') as [20/10/03], (select lost from tableName t2 where t2.school = t1.school and t2.[date] = '21/10/2003') as [21/10/03], (select lost from tableName t2 where...
  7. sneki

    SQL Loops - Calculating number of days between records in table

    Try with CURSOR: declare @var1 as type1, @var2 as type2, ... declare cusrorName cursor for your_select_statement open cursorName fetch next from cusorName into @var1, @var2... while @@fetch_status = 0 begin do_what_you_want_with_your_record... fetch next from...
  8. sneki

    isnull or case

    SELECT ISNULL(value1, value2) as col,... or SELECT col = CASE WHEN value1 is null THEN value2 END, ... What kind of statment is faster?
  9. sneki

    Convert a varchar to decimal

    SELECT CONVERT(decimal(10,5), columnName) from tableName
  10. sneki

    Executing some SQL from a variable

    ok, give me your variable.
  11. sneki

    Executing some SQL from a variable

    set @strSql = 'update...' exec(@strSql)

Part and Inventory Search

Back
Top