Forum Replies Created

Viewing 15 posts - 181 through 195 (of 484 total)

  • RE: Skip IF statements

    To directly answer your question, nest them.

    IF MyField = 1 
      BEGIN
        TRUNCATE TABLE AAA
      END
    ELSE
      BEGIN
        IF MyField = 2...
  • RE: Drive Letter

    Another possibility just occurred to me.  Is either the D: volume, or the directory where you are trying to put the file, marked for compression?  SQL Server will also not...

  • RE: Any possibility to to attach database files on a mapped network drive?

    By default, you cannot have a database file (mdf, ndf, or log) on a networked drive.  Network drives are considered too slow to handle rigors of database transactional volumes, and...

  • RE: Pass a value to a trigger...

    The suggestion of adding a lastupdated column onto the table is an interesting one

    Actually, I make it common practice to add LastUpdatedBy and LastUpdatedDate for virtually all tables.  Even without...

  • RE: Sum on a row

    Thanks, Jeff.  GROUP BY was what I intended.  Just a cut and paste error.

  • RE: Sum on a row

    Do you mean something like:

    SELECT
      LEFT(Drug_Name, CHARINDEX(' ', Drug_Name) as Drug,
      ...
    ORDER BY 
      LEFT(Drug_Name, CHARINDEX(' ', Drug_Name)
      ....

    Hope this helps

  • RE: No more SQL-DMO... eventually?

    BOL: SQL-DMO Mapping to SMO

  • RE: Declare or set column names

    No, you cannot use variables in that way, directly.

    But you can construct a SQL text variable, and use sp_executesql to run the query.  But be aware of the warnings Ray referred...

  • RE: Urgent! Backing Up Very Large Database

    Look in BOL for "Media Sets, Media Families, and Backup Sets".  In your case, substitute "\\.\tape0" with filenames, probably on separate drives.  But read this section carefully.  You will...

  • RE: What is wrong with my sql_executesql statement

    Just a couple of guesses you might want to try:

    First, I think since you are using nvarchar datatypes, you need to use Unicode strings.  Prefix your string constants with "N:,...

  • RE: Pass a value to a trigger...

    If you are only concerned with auditing the use of the stored procedure, why not write to the audit log from the stored procedure itself?

    Or, add LastUpdatedBy column to the...

  • RE: Log file

    If you want to easily keep log file to minimum, and can live with recoverability only to last full backup, change your recovery model to simple.  That will truncate the...

  • RE: Drive Letter

    Are you sure?  SQL server doesn't think so.

    More specifically, the Windows OS does not think so.  SQL Server will use WinAPI GetDriveType (see this MSDN article) to determine if...

  • RE: Backing up raw mdf/ldf files Online

    • You certainly can perform file/filegroup backups using native SQL Server backup. 
    • I don't think that any 3rd party general purpose backup (like Brightstor or Veritas) with their SQL Server agent...
  • RE: Drive Letter

    D: must not be recognized as a hard (fixed) drive.  SQL Server will not let you put database files on a networked mapped drive.  So if it is not in...

Viewing 15 posts - 181 through 195 (of 484 total)