let as suppose that we have a table with 12 columns: 1- ID int identity primary key 2- Name (nvarchar(150)) 3- BirthPlace (nvarchar(50)) 4- BirthDate (Date) 5- GovernorateID(int foreign key) 6- CancelCaseID (int foreign key) 7- AccommodateTypeID (int foreign key) 8- Deleted(bit), LifeCaseID(int foreign key) 9- FamilyMemebersCount(int) 10- ImmigrateOrResident (bit)] 11- ImmigrateDate (Date) 12- RegisterDateTime (DateTime) I have make a report in asp.net to list Information from this table. I need to Filter Results on each fields, else ID But not Always, just when the pars have a values. How Ex. I have Created a procedure with 10 pars I need to check each par if the par have a value add par value to Where condition And execute the SQL statement But before execute any SQL statement must check every par And for 10 pars must start from binary value 0000000000 until 11111111111 And if we consider that last two pars are composed of 3 values [0,1,2] because of [Deleted] & [ImmigrateOrResident] are bit not integers, bit is 1 or 0, what if I need to keep par null, I need to way, that way is with insert 2 value to par and add another lines of if statements Starts from 0000000020 until 1111111121 & 0000000002 until 1111111112 & 0000000022 until 1111111122 To cover all cases
I need to way to show you a procedure with 4 parameters full and work but cant add it here because of Characters number is limited
And the Goal of this Topic is to shortcut If statement with something else because now by what I explained up I need to more than 10000 line
Aucun commentaire:
Enregistrer un commentaire