Search Results

Search found 5 results on 1 pages for 'padmavathi'.

Page 1/1 | 1 

  • Stored procedure for selecting multiple records

    - by padmavathi
    I need to select records say 2000 from a table with a matching timestamp from c# .net code. Eg: SELECT * FROM ITEMDATA_TABLE WHERE ITEMNAME='Item1' and TimeStamp='2010-04-26 17:15:05.667' The above query has to execute for 2000 items more for the same timestamp. for this we can use SELECT * FROM ITEMDATA_TABLE WHERE ITEMNAME in ('Item1','Item2','Item3','Item4',......) AND TimeStamp='2010-04-26 17:15:05.667' from SQL Server Management Studio. I have tried appending all Item names to one string variable and giving it as a parameter to the stored procedure,but it resulted into a wrong concatenation. How can I do this as a stored procedure executing from the .net code? Can anyone suggest me/correct me in doing this? Thanks & Regards Padma

    Read the article

  • What is the maximum length of a string parameter to Stored procedure?

    - by padmavathi
    I have a string of length 1,44,000 which has to be passed as a parameter to a stored procedure which is a select query on a table. When a give this is in a query (in c# ) its working fine. But when i pass it as a parameter to stored procedure its not working. Here is my stored procedure where in i have declared this parameter as NVARCHAR(MAX) ------------------------------------------------------ set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go CREATE PROCEDURE [dbo].[ReadItemData](@ItemNames NVARCHAR(MAX),@TimeStamp as DATETIME) AS select * from ItemData where ItemName in (@ItemNames) AND TimeStamp=@TimeStamp --------------------------------------------------------------------- Here the parameter @ItemNames is a string concatinated with different names such as 'Item1','Item2','Item3'....etc. Can anyone tell what went wrong here? Thanks & Regards Padma

    Read the article

1