Viewing 15 posts - 181 through 195 (of 485 total)
To directly answer your question, nest them.
IF MyField = 1 BEGIN TRUNCATE TABLE AAA END ELSE BEGIN IF MyField = 2...
Mark
October 12, 2006 at 6:11 am
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...
Mark
October 12, 2006 at 5:55 am
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...
Mark
October 12, 2006 at 5:52 am
Actually, I make it common practice to add LastUpdatedBy and LastUpdatedDate for virtually all tables. Even without...
Mark
October 12, 2006 at 5:41 am
Thanks, Jeff. GROUP BY was what I intended. Just a cut and paste error.
Mark
October 12, 2006 at 5:34 am
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
Mark
October 11, 2006 at 4:03 pm
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...
Mark
October 11, 2006 at 3:45 pm
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...
Mark
October 11, 2006 at 3:38 pm
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:,...
Mark
October 11, 2006 at 3:29 pm
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...
Mark
October 11, 2006 at 2:59 pm
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...
Mark
October 11, 2006 at 2:53 pm
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...
Mark
October 10, 2006 at 2:28 pm
Mark
October 10, 2006 at 1:13 pm
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...
Mark
October 10, 2006 at 12:42 pm
Viewing 15 posts - 181 through 195 (of 485 total)