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!

Recent content by SajidAttar

  1. SajidAttar

    Please explain the CMD - executed by a job

    This is what I could understand from above command... Start cmd command window with Echo turned off execute the command and quit (don't leave the window open) loop through each file in log location path "G:\SQLData\MSSQL11.MSSQLSERVER\MSSQL\LOG" files having pattern *_*_*_*.txt and...
  2. SajidAttar

    View--Best way to accomplish

    Which version of SQL Server you are using? Did you give a try to Pivot operator? By "I need it all together" if you mean to have all six resultset / recordssets together in one single resultset, then you can use Union All. M2C... Regards, "Dream not what makes your sleep a pleasure, but...
  3. SajidAttar

    Instead of Insert trigger

    I think insert statement missing TrackingDate, hence the variable @TrackingDate has null value. When you concatenate values for @Message variable, it becomes null. Try changing variable assignment for @Message like this. Set @Message = @FileNumber + ' / ' + @BoxNumber + ' / ' +...
  4. SajidAttar

    Error Handling not working, any expert pls...

    this might be because of the error severety level is 16, that means the error can be corrected by developer and SQL server terminates the program here. EVEN TRY.. CATCH block will behave same. Try raising error of low severity. execute below code and study the procedure execution with error...
  5. SajidAttar

    It's all about money!

    Generate the script for the table (including default and other constraints) and post it here.. we will create the table at our end and see the behaviour. Do you have any trigger on the table? Regards, Regards, "Dream not what makes your sleep a pleasure, but what makes you work hard to...
  6. SajidAttar

    Notification using Policy Based Management SQL2008

    Hi, In SQL 2008 how can we notify connected client when there is update on perticular or all tables data. including which table's data updated through which client... I read that this can be done using Policy based management as SSNS has been removed from SQL 2008... but I can see table Facet...
  7. SajidAttar

    Skip unique row on BULK INSERT, any way?

    Which version of SQL Server you are using? if its 2005 then you can give a try to following code... SELECT * INTO #Test FROM Property WHERE 1 = 0 BULK INSERT #Test FROM 'c:\PristineTest.txt' WITH ( FIELDTERMINATOR = '|', ROWTERMINATOR = '\n' ) ;With Test as...
  8. SajidAttar

    SQL Agent Schedule Problem

    Hi Guys, Below is the link of the question posted on MSDN SQL Forum. Question posted is about SQL Agents behaviour when changed system calendar date to backward. I could not get proper forum for SQL Server Agent related queries, I am sure could get direction from this forum...
  9. SajidAttar

    dB design for multiple images

    on the flash I could think of adding new field of uid.. which can enable to have multiple categories for a single user and each category can have as many as details that user uploads.. Regards, "Dream not what makes your sleep a pleasure, but what makes you work hard to achieve it and...
  10. SajidAttar

    Tricky Date/Date Problem.

    If we assume that the X will be the appropriate value for A or P.. you can get the datetime parsed through following syntax... Declare @ADate varchar(20) Select @ADate = '20080111 0815a' Select @ADate = Stuff(Stuff(Upper(@ADate),14, 0, ' ') + 'M', 12, 0, ':') Select Convert(datetime...
  11. SajidAttar

    Trying to update last inserted record with For Insert trigger

    Hi.. Try something like below.. UPDATE A Set a.Primary_Vendor = c.Primary_Vendor From Warranty_Registration A Inner Join Inserted B On a.Warranty_Reg_Id = b.Warranty_Reg_Id Inner Join AEO_DEVL_SEQFLEXT C on b.Engine_Serial_No = c.ENG_SERIAL_NUM b..Engine_Model_Code = c.ENG_MODEL_CD...
  12. SajidAttar

    Sql Server Agent

    Hi.. I dont have any idea how your procedure processes the users table.. but if you are storing the datetime that the users table and using that value in your next process as start date then you should not be in trouble.. Regards, "Dream not what makes your sleep a pleasure, but what...
  13. SajidAttar

    Inserting data from a SP

    Did you try listing the column names in insert/exec statement, with the fields that procedure returns the values for and later update the additional field with separate update with your variable value.. WHILE @@FETCH_STATUS = 0 BEGIN INSERT INTO #DistinctProductVersions (VersionNumber...
  14. SajidAttar

    two sp_MSforeachdb questions

    Glad to help.. Regards, "There are no secrets to success. It is the result of preparation, hard work, and learning from failure." -- Colin Powell
  15. SajidAttar

    two sp_MSforeachdb questions

    I am sorry.. there were some hardcodes in above code.. here is the w/o h/c .. :) exec sp_MSforeachdb 'Declare @String varchar(255), @Message varchar(1000), @ul varchar(1000), @RecCount int Select @String = ''#Tab1'' Select @String =''%'' + @String+ ''%'', @RecCount = 0 Print ''?'' Select...

Part and Inventory Search

Back
Top