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 strongm 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: icemel
  • Content: Threads
  • Order by date
  1. icemel

    Complex date problem - help

    Hi, Here's my problem: Need to run weekly reports every Monday or Tuesday. However, regardless of which day we run the report on, it has to calculate sums of sales figures for the previous week starting on the previous SUNDAY. So if we run the report today, June 27th, I need the sales figures...
  2. icemel

    Date question

    Hi, Thanks for eveyone's help so far... it's been very helpful! My question now is this... I have a query that needs to find all the records that are within a certain time frame, see below: WHERE effectiveDate >= GETDATE()-7 and effectiveDate <= GETDATE() The problem is, GETDATE() starts at...
  3. icemel

    More cursor questions...

    Below is an excerpt from an article from SQL-Server-Performance.com. They sound like good ideas. However, they give no examples of how to transform a cursor using these methods. I suppose I should use my imagination. Is there someone who can illustrate an example of how to use each method...
  4. icemel

    CURSOR QUESTION

    Hi, I have a question about cursors. A "Forward_Only" cursor reflects changes to the underlying data, and does not use tempdb. A "Static" cursor does *not* reflect changes to the underlying data and *does* use tempdb. So, my question is, if you declare a cursor as: CURSOR LOCAL FORWARD_ONLY...
  5. icemel

    guest user - how to delete

    Hi, I notice that in all my databases, there is a "guest" user account with no associated login. It is "via group membership" (which group I'm not sure it's referring to - perhaps BUILTIN/Administrators, I don't know - any ideas?) I can't delete this user directly. How can I remove the "guest"...
  6. icemel

    command prompt in SQL job

    Hi, Not sure if I'm doing this right. I need to start an .exe from a job step. I selected "command prompt" as command type, and put this in the bottom section: cd d: cd myDir myExe.exe except that I don't think it worked. Is this the correct way to sequence commands? Thanks
  7. icemel

    default value in select

    Hi, What is the best way to write this? In a SELECT statement, if the value selected is null, then use a default value instead. Is a case statment the way to go? Thanks
  8. icemel

    Public role

    Hi, Where can I look to see what permissions are assigned to the "public" role? Thanks much
  9. icemel

    What's wrong w/ my cursor?

    Below is the cursor. Can't figure out why it doesn't like: SELECT count(*) FROM @name Thanks ------------ ALTER PROCEDURE myProc AS BEGIN DECLARE @name varchar(255) DECLARE c1 CURSOR FOR SELECT sysobjects.name as TableName FROM sysobjects WHERE type = 'U' AND...
  10. icemel

    Error message

    [Microsoft][ODBC SQL Server Driver][SQL Server]Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection. This ensures consistent query semantics. Enable these options and then reissue your query. The above error message periodically occurs during a...
  11. icemel

    Data file structure

    Hi, I was wondering if anyone could provide me with best practices or articles on the data/log/index file layout and directory naming conventions for SQL Server. Not so much where to put indexes and tables, RAID and all that, but more generally... the hierarchical layout of datafiles, etc for...
  12. icemel

    SQL Server 2000 Profiler

    Hi, For some reason, I've had poor results using Profiler (2000). Specifically, I am trying to find all object references for a given "DBUserName". I want to find out which tables, etc this particular database user is accessing. I created a filter on DBUserName where like = Username. I've...
  13. icemel

    mysterious reboot

    Hi, We have a sql server box here that ocassionally reboots in the middle of the night for no apparent reason. Aside from making sure that no scheduled tasks are doing this accidentally, how can I determine when, how, and why this is happening? Does the event log store this information? If...
  14. icemel

    one more question about running jobs

    Hi, I have this: exec (insert into myTable sp_help_jobschedule @job_name = "job1") exec (insert into myTable sp_help_jobschedule @job_name = "job2") exec (insert into myTable sp_help_jobschedule @job_name = "job3") but once again, syntax error on line 2. I'm sure it's something simple but not...
  15. icemel

    How to run this??

    Hi, I used a spreadsheet to create multiple lines of the same command but with different parameters. For example: sp_help_jobschedule @job_name = "job1" sp_help_jobschedule @job_name = "job2" sp_help_jobschedule @job_name = "job3" etc Now, I want to run these multiple lines in a query...
  16. icemel

    Very large backup

    Question about very large backup. If I am backing up to a local directory with 279 GB available, and the database size that I am backing up is 164 GB, is there any reason that space would be an issue?? Ok sounds silly, but this particular backup has been failing for reasons I can't explain...
  17. icemel

    Really need advice - filegroups!

    Hi, SQL Admin forum is very slow today... thought I might get a better response here. My question is: Is there a trick to doing filegroup backups? Here's my situation. I have a database with one primary data file and several filegroups. Each file group contains a very large table. So I back...
  18. icemel

    Filegroup b/u and restore, need help

    Hi, I am experimenting with filegroup backup and restore. On a test machine here, I did a backup of a single filegroup to a local disk. (SQL Server 2005) I then removed the backed-up filegroup from the database using 'ALTER DATABASE ... REMOVE FILE myFileGroup' Everything went fine until I...
  19. icemel

    Missing index script?

    Hi, Does anyone have a script for detecting missing indexes on all tables for a given database? Thanks much
  20. icemel

    Help - shrink file or shrink database?

    Hi, I have a database made of file groups. I just truncated a huge table in one of the file groups. I now need to shrink the database in order to free up the space to the os. Should I use the shrink database or shrink file command to do this? I don't have much experience working w/ filegroups...

Part and Inventory Search

Back
Top