Search results

  1. M

    View running very slow

    it doesnt work . ive tried that not sure why this is so difficult
  2. M

    View running very slow

    ok but if I add the as X not sure how to reflect this in the `count() because that surely must change too.
  3. M

    View running very slow

    I get incorrect syntax near ')'. expecting AS,ID or Quoted _ID. after the second bracket just before the IF statement
  4. M

    View running very slow

    ALTER PROCEDURE [dbo].[usp_AppProjectDetail] AS Declare @iCount as Int ; SET @iCount = (select Count(*) FROM ( SELECT Project.ProjID, Quarters.QTR_ID, UpldProjectDetail.ProjName, Department.DepartmentID, UpldProjectDetail.MultiPD...
  5. M

    View running very slow

    No it doesnt work . I will send the code
  6. M

    View running very slow

    all I changed in you code was added the SELECT but I get an incorrect syntax at the beginning of the IF statement
  7. M

    View running very slow

    Declare @iCount as Int SET @iCount = SELECT Count (*) FROM ( SELECT ProjectDetail_Q.ProjNo ProjectDetail_Q.ProjectNme Quarters.SnapshotDate FROM ProjectDetail_Q LEFT Join....... ) IF @iCount = 100 BEGIN Your INSERT goes here END
  8. M

    View running very slow

    dont think an alias is needed though
  9. M

    View running very slow

    Declare @iCount as Int SET @iCount = SELECT (Count (*) FROM ( SELECT ProjectDetail_Q.ProjNo ProjectDetail_Q.ProjectNme Quarters.SnapshotDate FROM ProjectDetail_Q LEFT Join....... ) IF @iCount = 100 BEGIN Your INSERT goes here END
  10. M

    View running very slow

    somethings not quite right with the brackets . been trying to figure its out but its not working .
  11. M

    View running very slow

    Fantastic and thanks . I will try it
  12. M

    View running very slow

    can anyone please help on the best way to compose the Logic for the following sample stored proc. 1.the main body is INSERT INTO SELECT .....sql 2.The select part returns 100 rows for example . how do I write the code to run the INSERT ONLY if 100 rows are returned Create procedure...
  13. M

    String or binary data data would be truncated error message

    thanks All for your help and suggestion . Isaac I think you are right . no shortcuts but I found a good link that helps generate the column lengths faster although I still have to compare the source and target manually with the bare eyes...
  14. M

    String or binary data data would be truncated error message

    Thanks . am just working on it but extremely painful process though .
  15. M

    String or binary data data would be truncated error message

    I'm running the query in SSMS . No it doesnt tell the column am afraid. the error Msg points to the 1st line of the insert query which doesnt tell me anything . am running SQL Server 2012. maybe this error tells you the column in later versions . ive googled this error and unfortunately I can...
  16. M

    String or binary data data would be truncated error message

    Hi I am executing an INSERT INTO Column1 Column2 SELECT FROM Column1 Column2 Statement with about 50 columns and getting the String or binary data would be truncated error .SQL doesnt tell you which column is the issue does anyone know the fastest way to find out the culprit...
  17. M

    translate IIFs in a where clause to CASE statements

    no wonder I omitted the single quotation mark '0' all makes sense now.Very well spotted . Thanks very much
  18. M

    translate IIFs in a where clause to CASE statements

    Apologies , ive now modified the code and this is the response I got from my colleague that wrote the Access query . this is the response I got the aim of the CODE is to find '0' and change to NULL . the data values might be coming in from the Source Application as null or blank but when...
  19. M

    translate IIFs in a where clause to CASE statements

    just a quick question please and a bit confusing is SQL Having a problem with the value 'N/A' because the other values in those columns are 'Green', 'Amber' etc as you can see from the code . I only get the error in the WHERE Clause but no error in the CASE part of the code before the...
Back
Top Bottom