SatishPutcha
Programmer
Hello Everybody,
Recently I moved an ASP-Access system to ASP-SQL2k5 database. I am also now using Stored Procedures.
My problem is:
I have a table called tblLocations with LocationID(PKey int) and LocationName(nvarchar(100)).
Now when using a stored procedure I send a parameter LocationID to get the Location name for that ID.
However I want it such that if I don't send a LocationID then it should retrieve all records.
I am able to do the same for Location name using
All help will be greatly helpful
~Satish
Recently I moved an ASP-Access system to ASP-SQL2k5 database. I am also now using Stored Procedures.
My problem is:
I have a table called tblLocations with LocationID(PKey int) and LocationName(nvarchar(100)).
Now when using a stored procedure I send a parameter LocationID to get the Location name for that ID.
However I want it such that if I don't send a LocationID then it should retrieve all records.
I am able to do the same for Location name using
Code:
SELECT LocationName FROM tblLocations WHERE LocationName= COALESCE(@LocationName, '%')
All help will be greatly helpful
~Satish