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: *

  1. hmscott

    "Class does not support automation"

    Paul, Many thanks. I had completely overlooked that option. I was beginning to lose a significant chunk of my hair over this one as it was beginning to extend to other DLLs that I have created over time. Thanks again, hmscott
  2. hmscott

    Using SQL Server AppRole

    I have one possible use for it that I am currently exploring. I have super users that add new users to the database by way of an admin module. Add new users is not a problem, but when I want to add a new super user, I runn into problems trying to add the db roles "db_accessadmin" and...
  3. hmscott

    Copy files from CD to PC - Change to Achive?

    If they all go into the same folder, can't you just right-click the top-level folder and uncheck the "Read-only" attribute? hmscott
  4. hmscott

    "Class does not support automation"

    I am getting an error "Class does not support Automation or does not support expected interface". Here are the circumstances: Operating system: Client: Win2K or WinXP Pro (error occurs on either) Server: Win2K (SP4) Application: IIS 5 (web server) Custom COM+ Object (built...
  5. hmscott

    Problem with Cursor on SP??

    Your very welcome. I hope it works well for you. Nigel, another convert for you. hmscott
  6. hmscott

    Parameters to Cursor !

    Unless I am much mistaken, parameters (or local variables) that are declared outside the CURSOR are still valid inside the cursor. So: DECLARE @MyParam1 varchar(10), @MyParam2 varchar(10) DECLARE MyCursor CURSOR FOR SELECT Column1, Column2 FROM MyTable OPEN MyCursor FETCH NEXT FROM MyCursor...
  7. hmscott

    Problem with Cursor on SP??

    Magda, There are several individuals in this forum and other who believe wholeheartedly that cursors are one of life's cardinal sins. I'm not one of them, but they do have a point (complexity, performance, etc). Consider this alternate solution. It doesn't directly address your situation...
  8. hmscott

    Q on Cursors !

    First, don't let Nigel read this post (Nigel, if you are reading this post, close it, close your eyes, say a short prayer and go on to the next post). :0~! From BOL: I would consider very carefully the need to have two cursors in one SP. There are alternate solutions (one might by using VB...
  9. hmscott

    Quick Question

    To create a column like Access' Autonumber, you use IDENTITY(SEED, INCREMENT) For example, try: CREATE MyTable ( ID INT IDENTITY(1, 1) NOT NULL, Data VARCHAR(20) NULL ) ON PRIMARY GO INSERT MyTable (Data) SELECT 'Record1' UNION SELECT 'Record2' UNION SELECT 'Record3' GO
  10. hmscott

    Problem with Cursor on SP??

    Try this (as an example only). -- Create table a create table a ( value1 varchar(10) null, value2 int null ) go -- Create identical table b create table b ( value1 varchar(10) null, value2 int null ) go -- Move 4 records into table b insert b (value1, value2) select 'one', 1 union all...
  11. hmscott

    Quick Question

    The first question is pretty straightforward. The equivalent to the MS Access Yes/No data type is the SQL "Bit" data type. Be aware however, that Access does some behind-the-scenes magic with Yes/No. In reality, Yes is stored as a -1 (negative one) and No is stored as a 0 (zero)...
  12. hmscott

    Problem with Cursor on SP??

    I guess my first question would be, why do you need a cursor here? It looks like a pretty straight forward INSERT statement would suffice (and cursors should be avoided where possible). 2nd, in the example you gave, you DECLARE LINES CURSOR FOR ... but you OPEN PARTIDAS was that a...
  13. hmscott

    SQL Server Rights

    With some hesitation, I would suggest you read the BOL entry for 'WITH GRANT OPTION'. I say hesitation, because I wouldn't recommend this strategy -- especially for UPDATE. But, as long as you are aware of the potential risks, the capability does exist. hmscott
  14. hmscott

    Crosstab in SQL Server

    There are some 3rd Party tools that will do this (www.rac4sql.com and another that I'm having difficulty remembering right now), but there is no native T-SQL to create the type of recordset you want. The CASE statement may help you if you have a defined number of headers (columns), or you can...
  15. hmscott

    Need to learn SQL Server. Any suggestion on how to start appreciated

    breaksr, Looks like you found it (?!?). Seriously, it seems that most questions receive attention here (or you can go to the programming forum for developer-oriented questions). I think the only courtesy most people would ask is that you look in Books on Line first before asking a question on...
  16. hmscott

    non-email alert

    If the SQL Server service account has the appropriate permissions and if you have the Messenger service on your laptop/workstation enabled, you can use the Net Send option (available on both jobs and alerts). I do not know if the messages are queued (ie, whether they will be delivered the next...
  17. hmscott

    Transaction Log Shrink issue

    Are the log files continuing to grow? Or are they just not shrinking to a smaller size? If the log files are continuing to grow in absolute size, you might have an open, uncommitted transaction (check by using SELECT @@TRANCOUNT) somewhere. You will need to find and kill that transaction. If...
  18. hmscott

    How to create a Foreign Key Contraint

    Here is a basic SQL script to create two tables and then add a foreign key constraint to the second table. CREATE TABLE Alpha ( ID int IDENTITY (1,1) NOT NULL, [Data] varchar(20) NULL ) GO CREATE TABLE Omega ( R_ID int NOT NULL, Data varchar(20) NULL ) GO ALTER TABLE Alpha ADD...
  19. hmscott

    control on a form as a criteria on views

    In SQL, views cannot accept parameters (unlike queries in MS Access). To accomplish what you are trying to do, you will need to create a stored procedure. For example, consider the following for the pubs database: CREATE PROC spSalesForStore ( @iStore as int ) AS SELECT * FROM sales...
  20. hmscott

    move db to another drive

    Hi, You actually have a couple of options. 1. You can use sp_detach_db to detach the database from the server. Then move the files using any MS windows tool (command line, Explorer, etc). When the file is back to where you want it to be, use sp_attach_db to re-attach the files. 2. You...

Part and Inventory Search

Back
Top