Forum Replies Created

Viewing 15 posts - 121 through 135 (of 992 total)

  • RE: ms sql help

    select top 15 date,dbname,tabname,size_used,size_reserved

    from myTable

    where date = '2008-12-25'

    order by size_used desc

    I guessed your table name - replace myTable as appropriate 🙂

  • RE: The Identity Debate

    Can o' Worms (TM) 🙂

    I'd have to say I'm in the middle and happy to be so. However in my latest systems in which I've worked we've made...

  • RE: Can MDF get restored: {repost, since no solution has been found}

    I cannot see anything significantly different from your other post here http://www.sqlservercentral.com/Forums/Topic453385-149-1.aspx. The answer there, sp_attach_single_file_db, is the way to go. And remember, backup, backup, backup...

  • RE: Query Problem

    Something like this should work. It allows a student's data to be reported even when they missed half of the year.

    declare @Table1 table(

    Student_Name varchar(50),

    ...

  • RE: TSQL: Computing Balance

    Hi,

    Try this

    --separate into two tables. The total due, from what I can see, is constant. If it's not constant then it should at

    --least still be in a separate...

  • RE: help with a very simple query

    Or, using a join instead...

    Select A.*

    from tableA A

    left join tableB B

    on A.PK = B.PK

    where B.PK is null

  • RE: select statement with order by

    Whilst it's clear to you that the two firstNames are the same, it's not quite so clear cut to MS SQL Server. You have two columns called FirstName being...

  • RE: Formulating a query with dynamic WHERE clause

    There are a couple of methods.

    If you can use an IF / ELSE block then do something like

    if @targetCol = 'A'

    select * from myTable where colA = @value

    else...

  • RE: linkedservers across domain

    He's using SQL authentication - the user account of the SQL server and the fact it's across Windows domains has nothing to do with it at all.

    Firewalls?

    As already asked, what...

  • RE: getting error "The system cannot find the path specified." using xp_cmdshell

    Also, just to future proof your code, enclose the filenames and paths in double quotes as in

    "c:\my folder\my file.txt" because without them you have 4 parameters to move rather...

  • RE: pro and con about foreign key constraint

    The other thing I had read about recently was about SQL Server's treatment of constraints and whether or not it trusts them.

    You may be aware that apart from referential integrity...

  • RE: Backup Device

    Are you asking why you wouldn't create a named backup device in MS SQL and use it to indirectly specify the file name for your backups?

    I've never bothered...

  • RE: variable use in top keyword

    You can do exactly that in SQL 2005. In SQL 2000 you had to do dirty hacks like using SET ROWCOUNT @val and then, after your...

  • RE: Difference between Union & Union ALL

    I'm not necessarily sure about the work table being there all the time or not. Certainly UNION ALL performs better than UNION because it doesn't need to do as...

  • RE: SQL statement

    Chris' way is the way most go with implementing this in practice (including me) 🙂 However if you have a number of different ways it can help...

Viewing 15 posts - 121 through 135 (of 992 total)