Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

Stored procedure recieves to much data after change in DB

$
0
0
In our sales database we import data from an external source. They have done some changes and the sales period now looks like this: 

 - 0113_AU
 - 0113_DK
 - 0113_EU
 - 0114_AU
 - 0214_EU
etc....

The problem is that i only want to fetch one period, example all sales for: 0113. But when i run my stored procedure now, it fetches all data when i write 0113. Here is the beginning and end of my procedure.

                 @period nvarchar

and 

                 sales.period_year_region = @period

How can i edit the last part so it fetches only for the periods that has 0113, and nothing else? Even when i write 0113_EU it receives to much data... 

Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>