如何在Microsoft Sql Server数据库中搜索? [英] How Do I Search In Microsoft Sql Server Database ?

查看:94
本文介绍了如何在Microsoft Sql Server数据库中搜索?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的项目中添加一个SEARCH按钮。

我应该为搜索按钮编写什么代码?











提前预付款

i want to add a SEARCH button in my project.
what code should i write for search button?





thanx in advance

推荐答案

I希望它会对你有所帮助.....



假设你创建了一个表,你就可以为这样的搜索创建商店程序。



I hope it will help you.....

Suppose you creating table and you can create store procedure for search like that.

CREATE PROCEDURE [dbo].[sp_Search_ByName](@Text nvarchar(50))
AS
BEGIN
SET NOCOUNT ON;
SELECT * FROM yourtable WHERE Name like @Text+'%' and Address like @Text+'%'
END


这篇关于如何在Microsoft Sql Server数据库中搜索?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆