Forum Replies Created

Viewing 15 posts - 16 through 30 (of 35 total)

  • RE: Query Help

    Both solutions worked very well.

    Would like to add additional criteria.

    Create table tmpUserDetails

    (

    Userid int,

    LocationIDint,

    Activityvarchar(200),

    OtherDatavarchar(200),

    RowDatavarchar(200)

    )

    truncate table tmpUserDetails

    insert into tmpUserDetails values (1,1,'Test','OD1','Row1-1')

    insert into tmpUserDetails values (1,1,'Test1','OD1A','Row1-2')

    insert into tmpUserDetails values (2,1,'Loc1','OD2','Row...

  • RE: Help on TSQL update statement

    Thanks for all the replies.

    Following query solved my problem.

    select b.UserID,b.ObjectID,b.cid,

    (select count(*) from @tblexample b2 where b.UserID = b2.UserID and b.ObjectID = b2.ObjectID

    and b2.StartDate < b.StartDate) as...

  • RE: Script Issue with insert

    The other question on the original posting, is why it would cause error, even when the insert scripts are inside the "If Object is null" block.

    At the compilation time,...

  • RE: Script Issue with insert

    Replace the insert scripts as below.

    exec ('insert into testa([ID],[IdDes],[IsActive]) values(1,''One'',1)')

    exec ('insert into testa([ID],[IdDes],[IsActive]) values(2,''two'',1)')

    exec ('insert into testa([ID],[IdDes],[IsActive]) values(3,''three'',1)')

    This worked.

  • RE: Help on XML read and insert

    Thank you. It helped.

  • RE: Not able to connect to ssms

    Please ensure "SQL Server services" are running.

  • RE: Create View- T-SQL Syntax error

    Nothing wrong with "If exists....drop...create" approach.

    Instead of performing two actions being done prior to Create, I was wondering if it could be minimized to perform only One action (check if...

  • RE: Need Help on basic syntax for SQL Function

    All the suggested solutions worked. Thanks.

  • RE: Moving databases

    Amazon CloudBerry Backup strategy seems to be one of the considerable solution for this situation.

    More details on this article at

    http://www.sqlservercentral.com/articles/Backup/70242/

  • RE: How to "where like in" or "where in like" possible?

    "Like" and "IN" are two seperate operators.

    Simplest approach is to use

    select * from my table where filed like '%papper%'

    or filed like '%pen%'

  • RE: Data load problem.

    The excel file is having tons of columns and I have multiple tabs.

    Can I get more details on how to use DotNet assemblies to read this kind of excel file.

  • RE: Query Help needed

    This code works perfectly.

    Thank you very much for the solution...:)

  • RE: Query Help needed

    This procedure works fine, as long the orderID have matching records in the orderdetails table.

    Example 1:

    exec p_Get_OrderSummary @ItemName = 'drums'

    This gives the correct results.

    OrderID | CustName |No.Items...

  • RE: Query Help needed

    Create Procedure Usp_OrderDetails

    (@ItemName varchar(20))

    As

    Select M.OrderID,M.CustName,(select count(OrderItemID) from OrderDetails where OrderDetails.Orderid=M.orderid),OrderDate

    From OrderMaster M INNER JOIN (

    Select Case When @ItemName IS NULL Then OrderMaster.OrderID Else D.OrderID End OrderID

    From OrderMaster LEFT OUTER...

  • RE: Query Help needed

    It would be "And". Assume if I have 10 searchable fields, and a search can be made on one field or a combination of fields.There is no gurantee, how many...

Viewing 15 posts - 16 through 30 (of 35 total)