Simple way to creating the Store procedure parameters for the table in SQL Server
Step 1: Pass the Table
name as parameter for
the below query and execute
Using the code
//
// code
//
declare @TableName sysname = '@TableName'
declare @result varchar(max) = ''
SELECT
@result =
@result + '
@' +
ColumnName + ' '
+ ColumnType + ''
FROM (SELECT
REPLACE(col.name, ' ', '_') ColumnName,
...
Tuesday, November 25, 2014
SQL Server Split Function
SQL Server Split Function
Split the input string
and convert to table in SQL Server
Introduction
This article explains
you about the SQL function
to get the table format while passing the comma separator string
Using the code
Copy the below code and page in the SQL editor
--//
--// Main
Function
--//
CREATE FUNCTION
dbo.Split
(
@Line nvarchar(MAX),
@SplitOn nvarchar(5) = ','
)
RETURNS @RtnValue table
(
...
Subscribe to:
Posts (Atom)