|
Thanks Andy,
Pretty much as I thought then, although your point about non-clustered indexes appending the primary key on is an interesting one. I had assumed that the non-clustered index would have some sort of 'pointer' which could read straight into one of the data files rather than a primary key value to lookup.
I would imagine this could make the indexes very large, especially as in my table there are 6 columns in the primary key. Worth thinking about!
Thanks again.
Regards,
Rob Philpott.
|
|
|
|
|
For a table with a clustered index, the pointer into the base table is the clustered index columns. If you don't like this, don't use clustered indexes.
A clustered index means that the actual data rows are stored in the leaf levels of the index.
If the non-clustered indexes stored some physical location data as the pointer value, as they do for 'heaps' (tables with no clustered index), the indexes would have to be updated as rows moved within a page or between pages due to additional records being inserted. This wouldn't be easy.
|
|
|
|
|
Hi friends
i need to perform by using stored processors.
can ne1 tell me how do i do it?
thanks
Pathan
GOD HELP THOSE WHO HELP THEMSELF
|
|
|
|
|
Hi
Do you mean that you want to pass current page, no. of records to display per page, total number of records etc....
This can be done.
Harini
|
|
|
|
|
One approach is to pass in the id of the last row of the previous page and select rows based on this value. For instance, to retrieve 20 rows at a time:
SELECT TOP 20 ....
FROM Table1
WHERE MyID > @ID To get the first batch, you would set @ID to 0.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
I would like to retrieve specific region names, where a region code is less then 3 characters. I cant just do a normal select query, as some of the codes are more then 3 characters. Here is my sql query, but its not returning anything.
SELECT RegionName, RegionCode
FROM Region
WHERE DATALENGTH(RegionCode) < 3
ORDER BY RegionName
|
|
|
|
|
Change query as below and try
SELECT RegionName, RegionCode
FROM Region
WHERE len(RegionCode) < 3
ORDER BY RegionName
|
|
|
|
|
Thanks alot. It worked. I never thought of LEN()...
|
|
|
|
|
hi everyone,
i need sample or tutorial of an application that work with ms access database (*.mdb) or sqlserver that installed in server and clients could run application with shortcut and work
i wanna create a networking application
many thanks
|
|
|
|
|
hamid_m wrote: clients could run application with shortcut and work
What does that mean?
hamid_m wrote: i wanna create a networking application
And what do you mean by "networking application"? To me a "networking application" means an application that configures networks.
|
|
|
|
|
hi,
i have two databases which are used for different projects. but i need to update a column of one database with the data from another database.
is there a way to do that using SPs? or any other way?
thanks.
regards.
|
|
|
|
|
You can do this job by these statement.
1)Declare a Variable like v
2)Select the record you want use by SELECT Statement and assign it to the v by = operator
3)Update the record you want by UPDATE Statement and set it to the v.
I hope this solution is useful
|
|
|
|
|
Here we go!!
Use joins (normal, left or right) between tables across the databases. You can call different databases in TSQL with dot operators (..).
Eg:-
Select n.name from northwind..authors n, pubs..aurhors p
where p.authorid = n.authorid
|
|
|
|
|
You need to prefix the schema.tablename with the name of the database. For instance:
Update database1.myschema.table1 set value = 10 where id = 20
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi
i want to see an example that how to use trigger in sql server 2005,thanks ..
|
|
|
|
|
Now, repeat after me:
Google is my friend. Google is my friend.
Clickety[^]
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I use SQL Server 2005 and Visual Basic 2005.
I write these Statement in SQL Server but it executes these with error and the record dose not inserted into table Project.
CREATE PROCEDURE Insert_Project
(@pNumber_M int,
@pRow_Agreement int,
@pRow_Machine int,
@pRow_Language int)
AS
BEGIN
SET NOCOUNT ON;
BEGIN TRY
DECLARE @Number_O int;
SELECT @Number_O=Number-sum(Number_A) FROM Machine_View WHERE Row=@pRow_Machine GROUP BY Number
SET @Number_O=@Number_O-@pNumber_M;
INSERT INTO Project
(Number_A,Number_D,Row_Agreement,Row_Machine,Row_Language)
VALUES
(@pNumber_M,@Number_O,@pRow_Agreement,@pRow_Machine,@pRow_Language)
UPDATE Project
SET Number_D=@Number_O
WHERE Row_Machine=@pRow_Machine
END TRY
BEGIN CATCH
SELECT ERROR_PROCEDURE() AS ErrorProcedure;
END CATCH
END
GO
Please help me.
Thank you.
|
|
|
|
|
mghiassi wrote: it executes these with error
What error?
|
|
|
|
|
Hi
The statement below return another code and not zero
SELECT ErrorProcedure AS ERRORPROCEDURE
Thanks for your help
|
|
|
|
|
mghiassi wrote: The statement below return another code and not zero
That is hardly helpful information. What code? If you remove the TRY/CATCH, what error is given (That should give you a textual description of the error)
|
|
|
|
|
Hi guys ! I have installed windows vista and i also installed microsoft sql sever 2005 express edition, and also I have downloaded the requierd update ! but when i want to create a database i get this message :
TITLE: Microsoft SQL Server Management Studio Express
------------------------------
Failed to retrieve data for this request. (Microsoft.SqlServer.Express.SmoEnum)
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)
------------------------------
The server principal "MRK\Mr.K" is not able to access the database "model" under the current security context. (Microsoft SQL Server, Error: 916)
|
|
|
|
|
hi,
i need a help in an automation of data fetch from db to excel.
I am having 2 tables in sql server db. at present i will type hundreds of number in excel sheet then i will import that to sql server as a table then executing that table and the primary table using some sql statement i used to fetch the required information. now the problem is when we are doing it for multiple records its too difficult to repeat the process repeatedly.so i want to automate this process.
for example:
primary table:
slno eno,ename, eaddress, ecity
exporting data through excel is eno
comparing this eno in excel with the primary table i can fetch the remining details to the specified set of eno.
how to automate if anyone have idea please share it. so that i can begin my process as soon as possible.
Tech_spidy
|
|
|
|
|
I would used DTS. It comes with SQL Server.
If you have sql server 2000 go to where you start enterprise manager. There is an icon that says import export. If you are using sql 2005 you need to go to the database you want to export the table. Right click the database go to tasks then export.
Pick your sql server name and database to export from.
Pick Excel from the drop down and set the output file name.
Then pick the table / table names or do a query.
I think that could work pretty nice for you process.
I hope that helps.
Ben
|
|
|
|
|
This is what i am already doing. I need a solution like by clicking a single button it has to export the data by executing the query in db.
Tech_spidy
|
|
|
|
|
i want copy of sql table on lan computre can i copy paste
how???
|
|
|
|