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. Ringers

    SQL error subquery returned more than 1 value .. when executing a SP?

    Some DML stuff. CREATE TABLE [dbo].[user_group_rights_new] ( [Group_id] [int] NOT NULL, [Menu_item_id] [int] NOT NULL ) INSERT INTO [user_group_rights_new] ([Group_id] ,[Menu_item_id]) VALUES (-5,-27), (-5,-26), (-5,-25), (-5,-24), (-5,-23), (-5,-22)...
  2. Ringers

    SQL error subquery returned more than 1 value .. when executing a SP?

    Lets see if i can make it clearer. user_group_rights_new Group_id Menu_item_id -5 -27 -5 -26 -5 -25 -5 -24 -5 -23 -5 -22 -5 -21 -5 -20 -5 -14 -5 -13 -14 1 -14...
  3. Ringers

    SQL error subquery returned more than 1 value .. when executing a SP?

    Thanks for the post borisalv, can you show me how I use a table variable I am still learning how to write stored procedures.
  4. Ringers

    SQL error subquery returned more than 1 value .. when executing a SP?

    Hi All, I am trying to automate this in a SSIS package. I can populate the user_groups table with the new groups for the new company. I just need to assign the menu access for new groups in the new company the same as company 1. user_groups table is many rows. It has a row for each group in...
  5. Ringers

    Find String in unformatted flat file

    SSIS 05 Hi All, I am trying to find a string "BOS" in a un-formatted flat file (it's a generated log file .txt), using SSIS to automate it. It doesn't have comma's or tab spacing it only has [CR LF]. So the data gets imported as one column with many rows and the odd empty row. I then use a...
  6. Ringers

    Update Composite Key

    UPDATE a SET a.group_id = b1.id from @user_group_members a inner join @user_groups b on a.group_id = b.ID inner join @userproperties c on a.user_id = c.User_id and b.company_id = c.company_id inner join @user_groups b1 on b1.company_id = b.company_id and b1.description = 'Non User' and...
  7. Ringers

    Update Composite Key

    OK I think I have worked a part of the issue. Well it solves the primary key error. select a.group_id, a.user_id, b.Description,b.company_id, c.gen_department, c.company_id from user_group_members a inner join user_groups b on a.group_id = b.ID inner join userproperties c on a.user_id =...
  8. Ringers

    Update Composite Key

    Thanks for the reply djj. can you show me what you mean, currently I am not joining to the user_group_members table.
  9. Ringers

    Update Composite Key

    Hi All, I need to update Table A which has a composite key from Table B and Table C. Update Table A Group_id to Table B ID Where the user_id in Table A is '1234' and company_id in B is the same as the users company_id in Table C and the Table B Name is like 'non user' Table A(dual PK) PK...
  10. Ringers

    Script Task for file exist not working

    Hi All, I have script task designed to look if a .xls file exists or not. It works correctly when the file is in network folder, but when it doesn't the False path doesn't fire. It still thinks it should look for the file and produces a check object exists error. Package uses two variables...
  11. Ringers

    Group By

    Hi All, I am unable to get my group by working. Current Results: [Title] [A] [B] [Name] [Count] Conference - Depot 0 0 Camille Wood 1 Conference - Other 0 0 Camille Wood 4 Conference - Other 40 0 Camille Wood 1 Days Worksite - Depot 100 100 Camille Wood 1...
  12. Ringers

    Instead of Replace

    Hi all, I have used replace to remove unwanted character in my join. It works and get the results I want but is there a more elegant or efficent way to do it? select * from xxxx.yyyy s inner join xxx.vvvvvv e on s.member_number =...
  13. Ringers

    Find Strings in DB

    Hi All, I have started a new job and there is no DBA and anyone who knew anything about the Dimension and DB's here is gone. I have been asked to write reports based on the old excel spreadsheets, which is fine but trying to a piece of data in a dimension or across multiple instance and DB's is...
  14. Ringers

    Multiple sub queries

    Hi All, I have added one inner query to my statement and need to add a second [on hand] so it is a new column in the orginial result set. Can someone please show me the correct syntax, they are all from the same table [MTR_MAT_SUPER_TYPE]. SELECT m.MTR_MATTER_ID, m.MTR_SERIES_CD, m.MTR_YEAR...
  15. Ringers

    Not Like including nulls

    Hi, I am trying to get records for the previous month and when they aren't finalsed\final. The SQL i have works correctly but the not like is also removing all the records that have a null in the [MTR_STATUS_CD] column. Can anyone tell me why? SELECT * FROM [MTR_MAT_SUPER_TYPE] WHERE...
  16. Ringers

    Join same table twice

    thanks for the reply, thats what i ended up doing and it works fine. SELECT Sh.LocationID, sh.code,Sh.Description, Sh.StartTime, Sh.Duration, sa.id as [Venue Booking ID],sa.ShiftID, sa.EmployeeID, sa.Date, E1.Code AS EmpCode,E1.Name...
  17. Ringers

    Join same table twice

    *Sorry can't find the edit post button for existing posts.* Hi All, I have 4 tables, Employee: Id, code, name, pos_def_id 213, Z300, Diana Benk, 108 ShiftAssigment: Id, shiftId, EmployeeID, date, assigmentReason_def_id 180, 3, 213, 2011-09-23, 198 Shift: Id,code,desc,locationID,duration 3...
  18. Ringers

    Join same table twice

    Hi All, I have 3 tables, Employee: Id, code, name, pos_def_id 213, Z300, Diana Benk, 108 ShiftAssigment: Id, shiftId, EmployeeID, date, assigmentReason_def_id 180, 3, 213, 2011-09-23, 198 Definition: Id, DefinitionCategoryID, description 108, 2, Full Time 198, 1, Medical You can see...
  19. Ringers

    Date in Variable

    looks like my statements are wrong the conversion statement doesn't work either. SELECT CONVERT(int, DATEADD(hh,Duration, 0), 114)+ StartTime FROM Shift
  20. Ringers

    Date in Variable

    Duration(INT as minutes) 210 210 210 1440 1440 StartTime(datetime) 1900-01-01 09:00:00.000 1900-01-01 09:00:00.000 1900-01-01 09:00:00.000 1900-01-01 09:00:00.000 1900-01-01 09:00:00.000 expected results 1900-01-01 12:30:00.000 as 210 minutes is 3.5 hours. Thanks

Part and Inventory Search

Back
Top