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 SkipVought 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. billchris

    Table View Record

    Another option depends on the permissions of your users. If they don't have sysadmin or db_owner permissions, you can DENY SELECT permission on the table and then write a stored procedure to do selecting on that table. You can log whatever you want in the stored procedure. “I apologize for...
  2. billchris

    Displaying random fields. How do I determine how many?

    CREATE PROCECURE GetQuestions @QuestionCount int AS SET ROWCOUNT = @QuestionCount SELECT ID, Question, Answer FROM RefresherQuestions WHERE (((RefresherQuestions.[Plant Section ID])=2)) ORDER BY RND(ID) GO You will have to prompt your user before calling the stored procedure...
  3. billchris

    Joining two queries

    SELECT ISNULL ( ( SELECT MIN(A.CODE) FROM TABLE_A A, TABLE_B B WHERE A.VALUE >= B.VALUE ), ( SELECT MAX(A.CODE) FROM TABLE_A A, TABLE_B B WHERE A.VALUE < B.VALUE ( ) “I apologize...
  4. billchris

    an irrelevant question - unexplained checkbox behaviour - hardcore thi

    I would try placing a second, unbound, checkbox on the form. Make the bound checkbox invisible. Then use the visible checkbox to display the opposite of the bound checkbox and to update the bound checkbox behind the scenes. I might get hairy to keep track of the events, but then it might be...
  5. billchris

    PRIMARY KEY problems

    The view that you are selecting from, INFORMATION_SCHEMA.constraint_column_usage, only displays records from tables for which the current user has permissions. Check to make sure the user that you are connecting with has permission to use/see the tables in question. “I apologize for this...
  6. billchris

    Select Statement.

    That would be something like this: SELECT t1.id, <other t1 fields>, <t2 fields>, <t3 fields> FROM table1 t1 inner join table2 t2 ON t1.id = t2.id inner join table3 t3 ON t1.id = t3.id WHERE t2.<conditionField> = <table2 condition> and t1.<conditionField1>...
  7. billchris

    Network failure

    It's been my experience that as soon as the client application connection is lost to SQL Server, the database automatically stops and rolls back any active transactions created by that connection. Am I missing something? I can think of one scenario where your problem might occur. Let's say...
  8. billchris

    convert int to mins, secs

    Matt, You can use DateAdd to add seconds to 0 and convert the result to a string in the format hh:mm:ss. select Convert(nchar(8), DateAdd(s,Avg(length),0),8) as 'avg call length' from callHistory This will work as long as the avg call length is less than 13 hours, because format...
  9. billchris

    Select Statement.

    Ok, is this more what you are looking for? SELECT t1.id, <other t1 fields>, <t2 fields> FROM table1 t1 inner join table2 t2 ON t1.id = t2.id WHERE t2.<conditionField> = <table2 condition> and t1.<conditionField1> = <table1 condition 1> and...
  10. billchris

    SQL Server - Using INSERT command within SELECT, for any conditions

    sivi, I usually jump into these questions without enough information and end up answering the wrong question based on invalid assumptions. So, this time I'm going to try something different and clarify. You have an audit table that looks something like this, correct? Audit --------...
  11. billchris

    SQL statement max size

    cash0, Thanks for the reply. I should have mentioned that I had never tested that code, I just derived it from Microsoft's documentation. I apologize for that. <Sarcasm> I can't believe their documentation was wrong!!! </Sarcasm> I'm glad it was some help, though. --Bill “I apologize...
  12. billchris

    Sendmessage across network

    Check out DCOM on MSDN at http://msdn.microsoft.com/library/en-us/dndcom/html/msdn_dcomtec.asp?frame=true. “I apologize for this long letter. I didn't have the time to make it any shorter” --Blaise Pascal
  13. billchris

    Roles and Rights.

    gazal, First off, you need to modify your table structure a bit. Right now you have these three entities,Login_DetailsParent_Menu_MasterChild_Menu_MasterWhat you need is this,Login_DetailsMenu_MasterRoleLogin_RoleMenu_RoleThe Login_Details table can remain the same, but here are the fields for...
  14. billchris

    ADO &amp; Recordset: Where is the recordset (or table) stored?

    The Sql statement that you are executing does not return any records. That's why the rs cannot be closed, it was never open. If Sql Server does not return anything to ADO, it doesn't need to open a recordset, so it won't. You should use a Command Object or the Connection.Execute method to...
  15. billchris

    Select Statement.

    Maybe, try this SELECT t1.id, <other fields> FROM table1 t1 inner join table2 t2 ON t1.id = t2.id WHERE t1.fieldx = <some condition> UNION ALL SELECT t2.id, <other fields> FROM table2 t2 inner join table1 t1 ON t2.id = t1.id WHERE...
  16. billchris

    SQL Server and Reports

    You might also look into Active Reports from Data Dynamics. I have used the standard edition to create and distribute PDF reports via the web. It did require some tricky asp and html because you have to save the pdf to disk on the server and then have the browser download the file. MSRP is...
  17. billchris

    DTS error

    It sounds like the query that DTS is calling to transfer the data is doing a group by on one or more of the nvarchar(4000) fields. I assume that you are trying to summarize the data as you are moving it. I would try moving the data to an intermediate table on the destination server without...
  18. billchris

    SQL statement max size

    Hi cash0, SQL Server can only update fields of type text, ntext and image with approximately 120kb at a time. I'm guessing that you are using an ntext field, which holds unicode strings and each character is two bytes, so you are limited to approximately 64k characters. What you need to do is...
  19. billchris

    Complex UPDATE problem.

    This will do what you want. Just change the values of the @RecordId and @NewValue variables. If you want to make it even easier, create a stored procedure. DECLARE @RecordId int, DECLARE @NewValue decimal(9,4) SET @RecordId = 123 SET @NewValue = 15 UPDATE tblA SET...
  20. billchris

    Login Failed for user '(null)'

    I think your problem is with Windows, not with SQL Server. You say the server name is CRM and yous loginid is CRM/Sam005. Is the windows CRM/Sam005 account defined as a local user on the server or is it a domain user defined on a domain controller? If it is a local user, then you will not be...

Part and Inventory Search

Back
Top