Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
2 dummy questions
Message
From
30/08/1999 16:03:34
 
 
To
28/08/1999 08:20:13
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00258791
Message ID:
00259365
Views:
18
Eva, on your second question, if the parameter is a character string you could use LIKE instead of =.

@lcparam varchar(255) = '%'

select * from mytable where mycolumn like @lcparam

If the parameter is not passed, then the default value of '%' is supplied and SELECT will return all records. I don't know about NULL vlaues, though.


>Hi,
>(1)
>I have two tables,
>one contains current records,
>2nd one contains history records.
>Selection will be: if records cannot be found in current, then go to find in history.
>Question: What's the best method in this case? I can only think that use IF..ELSE statement and dup whole set SELECT statements, it's quite dummy.....
>
>(2)
>I pass one parameter into stored prod,
>Question: Can I accept that, if the passing parameter is " " blank, then select all records, else, select the specified record?
>Is it the only method using IF..ELSE statement and dup whole set SELECT statement??
>What can I do???
>
>Pls HELP!!
>
>Best Regards,
>Eva ^.^
Previous
Reply
Map
View

Click here to load this message in the networking platform