Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Copy rows generator

By inugroho, 2013/05/21

This stored procedure is created from the need to copy rows from a table with new value. The script itself will create stored procedure proc_copyrows.
The parameters are
@TableName: the table name
@FilterField: filter field, default is null, means no filter
@SourceValue: the value of filter field from source data to be copied
@DestinationValue: the new value of filter field
@SourceDB: the source database, please add '..' at the end, such as 'pubs..'

Only @TableName is mandatory
The result is the SQL INSERT statement that can be copied and executed.

Enjoy yourself!

Total article views: 212 | Views in the last 30 days: 1
 
Related Articles
FORUM

Filter -Sum Total

Add Filter Criteria in a table then calculate totals for all fields at the end of the report.

FORUM

Filters - Report Builder

Filters - Report Builder

FORUM

Filter index

Filter index

FORUM

Filtering on data using the MAX function

How do I formulate this statement. I'm not selecting the field;just need to filter on it.

FORUM

Applying conditions to filters and grouping columns in report builder

taking count on each field and adding few conditions to the filter

Tags
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones