|
Good Morning smcnulty2000
Thanks for your reply
<b>smcnulty2000 wrote :</b>
Short answer: try removing the index.
Without indexes it run 2 Minutes 10 seconds
Thank you for the Advice.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
smcnulty2000 wrote: Short answer: try removing the index.
The index is on the source table, not the destination so its not going to help at all, - if it was the destination then I would agree (in principle) that it may help, but as you sya, how many records?
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
My error. I'm translating from another sql language but catching up.
At least now we know it is using the index.
Vuyiswa Maseko I'm eager to read how many records get processed.
Post the execution plan as well, if you can. That might get us some clues.
_____________________________
Those who study history are doomed to watch others repeat it. -Scott M.
|
|
|
|
|
I have an asp.net application (VB.Net, Reporting Services 2005) which includes a report viewer that displays a client-side report. The report displays normally, but the built-in find feature is not working from the report viewer on my webpage. When the report is displayed and I enter a search string in the find textbox and click Find, the report is redisplayed from the beginning, and does not indicate any "found" text. Maybe I wasn't using the right search criteria, but I couldn't find any reference to a problem concerning this.
The Report Viewer settings from the source are:
<rsweb:ReportViewer ID="IHEEView" runat="server" Width="100%" Height="99.3%" Font-Names="Verdana" Font-Size="8pt" ShowParameterPrompts="False" ShowCredentialPrompts="False" ShowDocumentMapButton="False" BorderColor="DimGray" BorderStyle="Solid" BorderWidth="1px" DocumentMapCollapsed="True" SizeToReportContent="True" AsyncRendering="False" ShowPageNavigationControls="False">
<LocalReport ReportPath="IHEEContractor.rdlc">
</LocalReport>
</rsweb:ReportViewer>
.
I am including Microsoft.ReporViewer.Common.dll, Microsoft.ReportViewer.ProcessingObjectModel.dll, and Microsoft.ReportViewer.WebForms.dll, all Version 8.0.0.0 in the bin folder.
This is due ASAP (isn't it always!?)
Help is greatly appreciated.
|
|
|
|
|
hi everyone,
iam just doing a sample task , of restoring 4 databases Parallely as well as sequentially, through C# code. (all together size of DB's are 2GB)
sequentially restoring database one by one.
Sequetial Total Time: 1 minute 20 Seconds (approx)
1st DB: 5 second
2nd DB: 30 Second
3rd DB: 25 Second
4th DB: 20 Second ( Total 1 munute 20 Second)
Parallel restoring database all atonce. The UI of sqlserver shows Restoring for all the databases simultaneously using C# threading code.
Parallel Total Time: 1 minute 45 Seconds (approx)
1st DB: 50 th second
2nd DB: 1 minute 20 th second
3rd DB: 1 minute 45th second
4th DB: 1 minute 45th second
the total parallel time should have been 30second because that was the max time taken by large database (2nd DB - 620MB approx), but it is not so in above case.
after several iteration the total Parallel time always takes more time than total Sequential time.
the same C# code other than restoring databases in SQL SERVER like (Copying files in code, Deploying IIS through code or any other processes) saves more than half of the time.
When it comes to sql server it takes more time(the same threading code). i need to give more specific reason to my team.
i could understand answer like stress will more on sqlserver ( server resources used more) which is not good.
can Someone tell me like specific reason does sqlserver can have only one active connection at a time ( Is this true or anything like this).
IS parallel restoring possible in Sqlserver, to put it simple.
looking for an urgent reply.
Thanks
Raja
|
|
|
|
|
hi ..
I am creating view in sql server 2000 as-
CREATE VIEW vwSam
As
(select admin.*, cust.FirstName+' '+cust.LastName as CustName
from adminmsgrecieved as admin,custdetails as cust
where admin.AdminId='111' and cust.CustId=admin.FromCustId )
From this i am getting an error invalid object adminmsgrecieved.
But when i run select query only then it works fine.
what problem may be???
and what should i do?
plz help me..
Thanx in adv
|
|
|
|
|
Try it without the parentheses.
_____________________________
Those who study history are doomed to watch others repeat it. -Scott M.
|
|
|
|
|
Have you made a typo? Received is usually spelled with ei after the c.
|
|
|
|
|
Try with "dbo." or "dbname." here dbname is your data base name infront of all data base objects like tables and views
hope it works
Thanks & Regards,
Anil Chelasani
|
|
|
|
|
Dear All, I have following statement to create procedure from an assembly
but i am getting error which says can't find type Assembly name
exec sp_configure 'clr enabled',1 --enable sql to execute CLR
reconfigure --install and run it
go
alter database TestTrigger set trustworthy on --enable Database to access external files
go
use TestTrigger
go
drop assembly WriteToFile
go
declare @dllPath varchar(500)
set @dllPath='C:\Documents and Settings\a.hamidy\My Documents\SharpDevelop Projects\WriteToFile\WriteToFile\bin\Debug\WriteToFile.dll'
create assembly WriteToFile from @dllPath with permission_set = external_access --create assembly from following dll file
go
--now create store procedure to access that dll file class + methods
create proc dbo.writeToFile
(
@filePath varchar(500),
@fileContent varchar(max)
)
as external name [WriteToFile].[WriteToFile].[writeInFile]
The last statement (create proc) gives this error
Msg 6505, Level 16, State 1, Procedure writeToFile, Line 2
Could not find Type 'WriteToFile' in assembly 'WriteToFile'.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
I solved it with this
as external name WriteToFile.[WriteToFile.WriteToFile].writeInFile
but now i am getting this error
Msg 6552, Level 16, State 3, Procedure writeToFile, Line 2
CREATE PROCEDURE for "writeToFile" failed because T-SQL and CLR types for parameter "@filePath" do not match.
let me mention the method paramater
public static void writeInFile(String filePath,string contents)
....
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
i have solved again
in store procedure creation i used nvarchar instead of varchar
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Hi
iam working on a task management system. The database is sql server 2005. In my database iam keeping the task details such as TaskName,EstimatedStartTime,EstimatedFinishTime etc. i want to calculate the difference of Estimated start and finish time to get the estimated time required to finish the task. The problem is that there may be holidays(saturday,sunday) in between this dates. And there will be only 8 Hrs for a working day. So how will i calculate the estimated time required to finish the tasks. No matter the format of the estimated time required, it may in minutes,hours or in days. Anybody please do a help. Thanks in advance
|
|
|
|
|
try this
select DATEDIFF(hour,'08:00:00','16:00:00')
Instead of startdate and enddate parameters use your column data from your table.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Here is what I've used in the past ...
Notice that there is a commented out function call reference that allows for custom logic to provide for holidays to be not considered working days. You would have to code the "IsDateAHoliday" function yourself.
-- You can try this out by invoking the statement: select dbo.GetBusinessDays(cast ('10/01/2007' as datetime),cast('10/09/2007' as datetime))
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date, ,>
-- Description: <Description, ,>
-- =============================================
ALTER function [dbo].[GetBusinessDays]
(
@StartDate datetime,
@EndDate datetime
)
returns int
as
begin
declare @DaysBetween int
declare @BusinessDays int
declare @Cnt int
declare @EvalDate datetime
select @DaysBetween = 0
select @BusinessDays = 0
select @Cnt=0
select @DaysBetween = datediff(Day,@StartDate,@endDate) + 1
while @Cnt < @DaysBetween
begin
select @EvalDate = @StartDate + @Cnt
--if (dbo.IsDateAHoliday(@EvalDate) = 0)
--BEGIN
if ((datepart(dw,@EvalDate) <> 1) and (datepart(dw,@EvalDate) <> 7))
BEGIN
select @BusinessDays = @BusinessDays + 1
END
--END
select @Cnt = @Cnt + 1
end
return @BusinessDays
end
|
|
|
|
|
Hi all,
I have a table Adp_Item_Conversion with following fields
ConversionID identity,
BranchID,
Itemcode,
BatchNo,
LotNo,
Date,
CTSCode
And i need to insert data in this table using a select query on other table as well as some predefined variables because the number of rows to be inserted is not fixed.
insert into Adp_Item_Conversion
(
BranchID,
Itemcode,
BatchNo,
LotNo,
Date,
CTSCode
)
select @branchID,Adp_master_detail.child_itemcode,@Br_No,@lt_No,@tr_date,@tr_code from Adp_master_detail where Adp_master_detail.Parent_Item=@ParentItemID
The problem is I have written an insert trigger on the table. The trigger only writes the last record to the log table. Although i have access to the trigger , i cannot change it now. So i need to rewrite the insert query so as to accommodate the insert as shown above and also the insert should be 1 row at a time. Can i use cursors or is there a other way round????
When you fail to plan, you are planning to fail.
|
|
|
|
|
Hi
I want to a site which shows all Sql Command explanation
Thanks
Satish Pai B
|
|
|
|
|
Try Microsoft.com
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Try Googling "sql commands". There is lots of good stuff there.
Regards,
Russ
|
|
|
|
|
|
Hi, thanks for looking
I receive a few app errors, the error says:
System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Data.SqlClient.SqlException: Conversion failed when converting the nvarchar value '26' And char(124)+(Select Cast(Count(1) as varchar(8000))+char(124) From [sysobjects] Where 1=1)>0 and ''='' to data type int.
What can this query do?? It will only return the same record. I think they wrote this n the querystring
I guess they were only testing if they could inject code
How could i test how secure is my app??
Thanks in advance
Alexei Rodriguez
|
|
|
|
|
There's an excellent article on SQL Injection attacks (and how to prevent them) here[^].
|
|
|
|
|
here is an sql query in which all fiels are correctly written-
(select admin.*, brok.FirstName+' '+brok.LastName as BrokerName
from adminmsgrecieved as admin,brokerdetails as brok
where admin.AdminId='111' and brok.BrokerId=admin.FromBrokerId ) as custo(AdminId,FromBrokerId,FromCustId,Subject,DateOfMsg,Message,Status,MsgId,BrokerName)
but i got an error "syntax error near as" .This problem is near as custo(..........). Actually I am giving table name generated from query-
(select admin.*, brok.FirstName+' '+brok.LastName as BrokerName
from adminmsgrecieved as admin,brokerdetails as brok
where admin.AdminId='111' and brok.BrokerId=admin.FromBrokerId )
what it may be??
plzz help.....
|
|
|
|
|
Try rewriting the SQL without using 'as'
select admin.*, BrokerName = brok.FirstName + ' ' + Brok.LastName
from adminmsgrecieved admin, brokerdetails brok
where admin.AdminId='111' and brok.BrokerId = admin.FromBrokerId
Also, for future reference, specify what type of SQL database you are using: Oracle, SQLServer, MYSQL, etc. Syntax varies based on the type.
Tim
|
|
|
|
|
thanks...
I am using sql server 2000.It is working well without as but i have to give a name to the table generated fom selet query.This table name will be use further for another join query.so plz guide me how can i give a name to the table.
|
|
|
|
|