For my database I create a new query and wrote
select * from dbname
using SQL Server Management Studio Express 2005. Saved it by name SQLQuery1.sql on the desktop.
Now I would like to call this query from C# code when an ASP.NET button is clicked and display the results in a gridview.
How do I call the query? Can I tell Visual Stud...
This is a query based on the Northwind Database in MS SQL Server 2005.
First I have to get the average of the UnitPrice from OrderDetails table, and group it by ProductID for that particular column alone and alias it as AveragePrice.
Then I need to find the maximum(AveragePrice) which is nothing but the max of previous column, how can ...
I'm on a project where I was asked to take a quick peek at some reporting SQL (in a SQL Server 2K5 environment) and was surprised at what I found: 4 to 5 levels of subquerys, distinct clauses, unions, and NoLock hints (which were needed because the SQL was running so long it was blocking standard processing) - all in the same set!.
Beca...
Here is the question:
+--------------+
Ships |
+--------------+
Duke of north |
---------------+
Prince of Wales|
---------------+
Baltic |
---------------+
I need to replace all characters between the first and the last spaces (excluding these spaces) by symbols of an asterisk (*). The number of asterisks must be eq...
Will Mssql be even fast when I query on a view opposed to one query?
example
When I have this view:
create view ViewInvoicesWithCustomersName
Select * from Invoices left join Customer on Customer.ID=Invoices.CustomerID
What will be faster or will it be even fast?
a) select * from ViewInvoicesWithCustomersName where customerName="B...
I am trying to setup a merge replication from SQL Server 2005 to SQL Compact 3.5 sp2. My environment:
- Server: Windows 2008 R2 64bit
- SQL Server 2005 installed on server
- IIS 7 installed on same server with IIS6 compatibility components installed
- SQL Server Compact 3.5 SP2 Server Tools installed on server
I create the publication ...
Hello Everyone!
I've got confused at the moment.
I've got one database to developed for MLM (Multi level marketing) company. so, there's one Members database.. each member have unique ID called membercode.. and all members can members under them.. can make 2 members down to 1 member.. all members are added in same table named "tbMembers...
I'm using Visual Studio 2008 Pro.
I'm probably missing something very obvious here, but I've been trying to get the CTP for Sql Server compact 4 to work in my asp.net mvc application. I can find next to no instruction on how to set this up or a working example application. My goal is a private install so I can just include it in my web ...
The title is the question
Thanks
...
is there an elegant object-orient based framework?
...
Hi Folks !
Any one there can help me ?
I have two tables as NEWS table & WEBSITE table
Third table is mapping table named WEBSITE_NEWS_MAP
News Table - news_id int not null(PK), news_description varchar(200), news_date datetime.
Website Table :- Website_id int not null (PK), Website_Name varchar(200), Website_Description varchar(10...
Possibly some of you don't even know about these features so you will learn a lot from this post which will in fact help me to optimize better and some of you probably use them on daily basis so you can help me and other less DBA proof users.
I'm using SQL-Server 2005 Standard
I run SQL Server Profiler a lot. Each time i find ad hoc qu...
I have one table with columns channel, value and timestamp, and another table with 7 other columns with various data.
I'm joining these two together, and I want to select the maximum value of the value column within an hour, and the timestamp of the corresponding row. This is what I've tried, but it (obviously) doesn't work.
SELECT
...
I'm working on a Delphi project with a MS SQL Server database, I connected the database with ADOConnection, DataSource and ADOProc components from Borland Delphi 7 and I added this code in behind:
procedure TForm1.Button2Click(Sender: TObject);
begin
ADOStoredProc1.ProcedureName := 'sp_Delete_Clen';
ADOStoredProc1.Refresh;
ADOStor...
Sorry for bad english.
bfproduct is a table and productid is primary key in this table and productname is another field defined in this table.
When i execute this query, select * from bfproduct where productid in (23,5,54,3132,32). The result is as follows:
productid | productname
5 15 Park Avenue
23 Good Boy Bad Bo...
declare @name varchar(156)
set @name ='sara'
--Query 1:
SELECT [PNAME] FROM [tbltest] where [PNAME] like '%'+@name+'%'
--Query 2:
SELECT [PNAME] FROM [tbltest] where [PNAME] like '%sara%'
suppose that there is a NoneClustered Index on [PNAME] column of [tbltest].
when running Queries, Excution plan show index Seek For Query 1 an...
Hi,
how can we select the index of the first alphabet in a text column in sqlserver?
...
I recently created a couple inline table-valued UDF's and then referenced them in a couple views using Cross Apply in one case and Outer Apply in another case. After I got it working and tested, I thought it was a pretty cool use of UDFs and Cross/Outer Apply's. But then it occurred to me that I probably could have done the same thing us...
Hello,
How to create a view from table A from server 1 and table B from server 2, based on a same column named as col? They use different credentials. The servers are SQL Server 2005
Thanks!
...
Hello Everyone,
I need to upload excel sheet in to the database. Which i am doing with the query
SELECT * INTO temp FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\Dokumente und Einstellungen\l.varada\Desktop\BA-Control.xls',
'SELECT * FROM [qry_BA_Controlling (Report)$]')
Here C:\Dokumente und Einstellungen\l....