Search
 
SCRIPT & CODE EXAMPLE
 

SQL

pass array parameter to stored procedure c#

CREATE TYPE dbo.IDList
AS TABLE
(
  ID INT
);
GO

CREATE PROCEDURE dbo.DoSomethingWithEmployees
  @List AS dbo.IDList READONLY
AS
BEGIN
  SET NOCOUNT ON;

  SELECT ID FROM @List; 
END
GO
Comment

pass array parameter to stored procedure c#

CREATE FUNCTION dbo.SplitInts
(
   @List      VARCHAR(MAX),
   @Delimiter VARCHAR(255)
)
RETURNS TABLE
AS
  RETURN ( SELECT Item = CONVERT(INT, Item) FROM
      ( SELECT Item = x.i.value('(./text())[1]', 'varchar(max)')
        FROM ( SELECT [XML] = CONVERT(XML, '<i>'
        + REPLACE(@List, @Delimiter, '</i><i>') + '</i>').query('.')
          ) AS a CROSS APPLY [XML].nodes('i') AS x(i) ) AS y
      WHERE Item IS NOT NULL
  );
GO
Comment

PREVIOUS NEXT
Code Example
Sql :: nosql databases 
Sql :: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it (SQL: select * from `featured_categories` limit 1) 
Sql :: mysql select 
Sql :: SQL server datetime compare 
Sql :: what is in operator 
Sql :: subquery in select 
Sql :: group functions in sql 
Sql :: mysql order by desc 
Sql :: count with where 
Sql :: cast float mysql 
Sql :: sql server standard 
Sql :: sql int size 
Sql :: How to do IF NOT EXISTS in SQLite 
Sql :: find employee with max salary sql 
Sql :: open mysql port bitnami tomact 
Csharp :: minimize window form c# 
Csharp :: hello world program in c# 
Csharp :: c# how to run external program 
Csharp :: c# random int 
Csharp :: bitmasking in c# 
Csharp :: c# input integer 
Csharp :: unity to integer 
Csharp :: c# AllowSynchronousIO to true 
Csharp :: Animator.GotoState: State could not be found UnityEngine.Animator:Play (string) 
Csharp :: dotnet executable directory 
Csharp :: c# copy to clipboard 
Csharp :: get object clicked unity 2d 
Csharp :: c# length 2d array 
Csharp :: check if gameobject exists unity 
Csharp :: stop process c# 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =