Showing posts with label sql server stored procedure. Show all posts
Showing posts with label sql server stored procedure. Show all posts

Monday

return table from stored procedure

To return table from stored procedure:
declare value as table in sql and fill it from stored procedure by insert..execute like in this code below:

DECLARE @Accounts1 AS TABLE
(
customer NUMERIC(9, 0),
sub TINYINT,
tp1 VARCHAR(100)
)


insert into @Accounts1
execute usp_AccountDifferentialReportSelector @Did,@CycID

Friday

rework dynamic sql into stored procedure with optional parameters


CREATE PROCEDURE TestProc
(
@Param1 varchar(50) = NULL,
@Param2 varchar(50) = NULL,
@Param3 varchar(50) = NULL
)
AS
SELECT
*

FROM
TestTable

WHERE
((@Param1 IS NULL) OR (col1 = @Param1)) AND
((@Param2 IS NULL) OR (col2 = @Param2)) AND
((@Param3 IS NULL) OR (col3 = @Param3))


make ubuntu business casual

to make ubuntu business casual - make it black remove background: gsettings set org.gnome.desktop.background picture-options ...