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 Chriss Miller 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: Ringers
  • Content: Threads
  • Order by date
  1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. 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...
  6. 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 =...
  7. 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...
  8. 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...
  9. 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...
  10. 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...
  11. Ringers

    Date in Variable

    Hi, I am trying to add two columns from table SHIFT. Column DURATION(INT) to COLUMN STARTTIME(datetime) and then put the result in a variable. 1. Convert DURATION to hours; SELECT CONVERT(varchar, DATEADD(SS,Duration, 0), 114)+ StartTime FROM Shift 2. Add results into variable, not sure how...
  12. Ringers

    Two Databases

    Hi All, I need to compare a two columns from different databases, DB SSAT: ID and DB SNAP:CODE, both are VARCHAR. I have setup two datasources with these DB's and written a basic select for each that pulls the column. What is the best way to compare them and ask if they are the same? Thanks
  13. Ringers

    AND type in (N'U'))

    Hi All, Can someone tell me what this means from my table schema script, AND type in (N'U')); I understand the N means unicode but what about the 'u', thanks. GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[companies]') AND type in (N'U')) BEGIN CREATE TABLE...
  14. Ringers

    SSIS Packages & SSSMS Jobs Security

    Hi All, On my local XP machine logged on with non admin windows account. I have created an whole bunch dtsx packages in BIDS 2005 to upload data to a FTP folder. I then created some jobs in SSMS 2005 to run these packages\jobs every morning. I found that the SQL server agent account didn't have...
  15. Ringers

    Better Structured Case Or Coalesce

    Hi All, I was wondering if there was a better way to structure my case statement, as you can see it is a bit long :) maybe with Coalesce? SELECT CASE WHEN RowId = 1 THEN Invoice_id ELSE null END AS [Invoice_id], CASE WHEN RowId...
  16. Ringers

    derived column isnull

    Hi All, I am trying to change column [division\buyer] when column [division code] is blank or null to "Starcom - Non Tech". It seems that the right hand side TRIM() of my condition statement works but not the left side ISNULL(). The code is black and it changes [division\buyer] correctly when...
  17. Ringers

    Don't show null

    Hi All, I have a SQL script that uses select, CTE and a whole bunch of case statements.(see attachment link) The script is fine and returns everything I need, But it shows null when there is no data. I have datatypes datetime,int and varchar. Is there a way to show a empty or blank field...
  18. Ringers

    Cast as

    Hi, I am using a case statement to check for row numbers. But I want to change the format of a date and number fields. 1. Current: June 29 2011 12:00 AM Expected: dd/mm/yyyy(no seconds) Code: CASE WHEN RowId = 1 THEN CAST(IssueDate AS VARCHAR(20)) ELSE '' 2. Current...
  19. Ringers

    Unique Row with details

    I am trying to write SQL that will show the invoice_head details and every invoice_line(purchase orders). The catch is for everytime there is a purchase order over the first row, you don't repeat the invoice head row. I have attached a excel spreadsheets that show the format of invoice that I...
  20. Ringers

    SQL Data Grouping

    Hi, I am trying to get the invoice data from the invoice_head table(single row) with the invoice_lines(purchase orders) on certain conditions. The where is fine but SQL doesn't like binding any of the invoice_lines columns.Which why I have tried putting in a nested select statement. SELECT...

Part and Inventory Search

Back
Top