Must pass parameter number 2 and subsequent parameters as '@name = value'

In SQL Server, I am trying to pass more than one value to @businessArea parameter in my stored procedure. I tried it with using IN clause but it gives an error as follow (but when I pass one value to @BusinessArea parameter, it works). How can I correct it? Any help is much appreciated. Must… Read More Must pass parameter number 2 and subsequent parameters as '@name = value'

Use (insert and select) temp table in the store procedure

I use below code to create procedure to using temp table Go create procedure testTempTable as INSERT INTO #resultTbl (code,userName) SELECT code,userName FROM Customer select * from #resultTbl Go When I want to run the procedure with exec testTempTable says Invalid object name ‘#resultTbl’. How can I use temp table in the procedure? >Solution :… Read More Use (insert and select) temp table in the store procedure

Save execute results into a table

Below is a simplified postgres stored procedure I am trying to run: create or replace procedure my_schema.tst(suffix varchar) as $$ begin execute(‘ select * into my_schema.MyTable_’||suffix||’ From my_schema.MyTable ‘); end; $$ language plpgsql; When I attempt to run using something like: call my_schema.tst(‘test’); I get this error Invalid operation: EXECUTE of SELECT … INTO is… Read More Save execute results into a table

Transfer data from one table to another identical table

SET IDENTITY_INSERT [db1].[dbo].Subscriber ON INSERT INTO [db1].[dbo].Subscriber SELECT * FROM [db2].[dbo].SubScriber PRINT ‘Successfully Re-imported data from SubScriber backup’ SET IDENTITY_INSERT [db1].[dbo].Subscriber OFF All I want is a dynamic way to copy data from one table that has an identical setup as another table in another database but I continue to get this error: An explicit… Read More Transfer data from one table to another identical table