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 Wanet Telecoms Ltd 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. SajidAttar

    Please explain the CMD - executed by a job

    ...(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 last modifed at current day - 30 days Replaces STDERR with STDOUT (to have all output at single location) If file exists...
  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...

    ...severity. execute below code and study the procedure execution with error handling CREATE PROC ErrSev16_one AS BEGIN DECLARE @ERR INT SELECT * FROM SDSCallDetailAA SELECT @ERR = @@ERROR IF @ERR <> 0 BEGIN PRINT 'ERROR OCCURED A' END END go CREATE PROC ErrSev16_TWO AS BEGIN...
  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

    ...= 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 **This is not tested.. if you get any error do fix and run it. HTH. Regards, "Dream not what makes your sleep a pleasure, but what makes you work...
  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

    ...so.Xtype = ''P'' and PatIndex( @String, sc.Text) > 0 Order By so.Name Select @RecCount = @@RowCount If @RecCount > 0 Begin Select @Message=''* ''+ convert(varchar(8),@RecCount) + '' Stored procedure(s) found in database ? having the string "'' + @String + ''" *'' Select @ul =...
  16. SajidAttar

    two sp_MSforeachdb questions

    ...= sc.Id Where so.Xtype = ''P'' and PatIndex(''%#Tab1%'', sc.Text) > 0 Select @RecCount = @@RowCount If @RecCount > 0 Begin Select @Message=''* ''+ convert(varchar(8),@RecCount) + '' Stored procedure(s) found in database ? having the string "'' + @String + ''" *'' Select @ul =...
  17. SajidAttar

    two sp_MSforeachdb questions

    Hi.. You need to concatenate the database where you are printing the message that says your '* Stored procedures containing...' Change the following line in your procedure sp_FindSP SELECT @msg=''* Stored procedures containing string "'' + @s + ''='' + convert(varchar(8),@@rowcount) + ''...
  18. SajidAttar

    Find Minimum of list of Fields

    Also can be achieve the same using union and aggregate functions.. Select min(Value) MinDate, max(Value) MaxDate From (Select Field1 as Value From table1 Union all Select Field2 from table1 Union all select field3 from table1 Union all select field4 from table1) a Regards, "There...
  19. SajidAttar

    Need help obtaining a date in a query

    Have a look on datediff function..you can use this function with your date column and getdate function .. Regards, "There are no secrets to success. It is the result of preparation, hard work, and learning from failure." -- Colin Powell
  20. SajidAttar

    Table JOIN Query

    Try following query .. .(I have not checked the query as I dont have data.) SELECT ISNULL( M.TeamMemberID, '') TeamMemberID, T.TreatmentID TreatMentID, ISNULL( P.ProductType, '') ProductType, T.Treatment Treatment FROM tblTreatment T (NOLOCK) LEFT OUTER JOIN tblProductTypeTreatment PT...

Part and Inventory Search

Back
Top