Hi!
I started to use SQL for a few days, so i'm just a beginner.
I want to do the following: I want to run a query in everey month, which gives back the data i need, then store it in an .xls file or something else, and then send it to some recipients. Can i do this fully automatically somehow in SQL Server 2005? Could someone give me an...
Need to write a SQL query to search special character in a column. Text needed to search is 'R&D' but issue is that SQL server 2005 is taking it as a logical operator.
Any help?
...
Hi everybody,
How can I find out if a datetime column in my table is in a specific hour interval (e.g 13:07 - 15:15) and in a specific day (e.g Thursdays) in a SQL select statement?
Thanks,
...
I have a query with parameters inside a Devart TMSQuery.SQL. Something like
select * from customers
where customer = :CustomerID
in code I do
// Delphi
sqlcustomer.ParamByName('CustomerID').asinteger := 4;
sqlcustomer.open;
I want to debug and see the exact sql command sent to the server, if I try to use TMSQuery.sql I just have th...
I would like a tool that monitors sql server while I test my application. THe applicatino will of course run different queries.
From the tool I would like an output like:
- this query was slow because index is missing on this field
and this kind of info.
But I'd like to have a way to highlight crucial data, there can be for example 10...
My application connects to an arbitrary (configurable) instance of SQL Server.
If the instance is local, the application needs to ensure that the SQL service is started before connecting.
Given the name of the instance, how do I determine the name of the service to start?
...
Hi,
I have a query that takes 5 seconds to run in SQL Server Managment Studio, but it takes 33 seconds in PHP to run the same query using *$qid=db_query($countQuery);*
Has anyone got any idea why this might be?
We are using SQL Server 2000 which I do not believe is the problem.
[edit]
After doing some profiling we noticed that the exe...
Hi,
I've been given the following task:
An external source will write a name, datetime and value to a database table (table A) at random intervals. I need to copy this data to another table (table B) and delete the row in table A. If the name doesn't exist in a lookup table then the row needs to remain in table A until it does and then...
I crate temporary table in c# (one column, type int), later I want to put ~40 000 values inside (it will be constantly changing). What is the fastest way of doing it ?
...
Hi,
I'm using the varchar(MAX) value for text but as I'm building up the huge SQL it cuts the ending off.
Is there any way I can create a Dynamic Declare statement that I can then join together with others when executing the sql?
e.g. something like:
DECLARE @sSQLLeft + Convertvarchar(4),@index) varchar(MAX)
...
Hi,
I'm currently setting up replication in order to produce a database that will be used to run reports and take load of the main database.
According to the guide at:
http://msdn.microsoft.com/en-us/library/ms151799(v=SQL.90).aspx
You setup mirroring, which we use for high availability after the publisher has been configured. I was ...
I'm using Hibernate with Joined-SubClasses to Map a class hierarchy to a
database. Unfortunately this causes deadlocks when an object is updated while a
different thread is trying to load the same object. With objects that are mapped
to a single table this is no problem. This seems to be caused the way MSSQL
acquires locks on the table...
I have a field with birthday as either '7/08/1986' or '07/08/1986'.
I want to convert the value to like this '1986/08/07'. Simply converting from DD/MM/YYYY to YYYY/MM/DD. Kindly note down this is all in SQL Server 2005.
Additionally, if the date is in single digit means still the output shd be shown in double digit like '07' not '7'.
...
I know how to send mail using an SMTP server specified in a mail profiler in the Database Mail of Sql Server.
You would do it like so:
EXEC msdb.dbo.sp_send_dbmail @profile_name = 'profile',
@recipients = @email,
@body = @body,
@body_format = 'HT...
I have to run a select statement across several tables. I am sure the tables return different records. I am anyway using UNION ALL.
Is it better to use UNION or of UNION ALL in performance terms when I am sure the tables return different records?
...
Assume I have the following query:
Update LPMBonusReport Set BoxID = (Select ContainerSerialNumber
From Wip.vwWorkItem Where SerialNumber = LPMBonusReport.SubID)
The object Wip.vwWorkItem is a view.
Assume there are 100 rows in the LPMBonusReport table. Would the view get materialized 100 times, once for each row in LPMBonusR...
Hi
Need help with this SQL Server 2000 procedure. The problem is made difficult because I'm testing procedure via Oracle SQL Developer.
I'm running the procedure to iterate column with new sequence of numbers in Varchar format for those who have null values.
But I keep getting error, so a) I may have done a wrong approach b) syntax i...
Hey,
I have a production system running on an SQL Server 2008 DBMS, in Full recovery mode.
I take a full backup each day at midnight, a log backup every two hours, and a differential backup every 6 hours (06:00, 12:00, 18:00, but not midnight as the full is taken then).
In recent days however I've noticed that the diff backup filesize...
I have (adjusted for the sake of simplicity) a table containing 2 columns - start and end, both of which are time stamps. These represent phone calls.
I need to produce what boils down to a graph, with time along the X axis, and simultaneous calls along the Y axis.
I can extract the number of concurrent calls at any given time quite ea...
Hello,
I have a database which contains 100's of stored procedures. I want to find which the longest stored procedure in these. How can i find it?
Currently i am using
Select text,MAX(len(text))
from syscomments
group by text;
But i am not able to find the name of stored procedure in it.
Thanks in advance :)
...