Hello,
I saw a similar question which asked how to monitor the progress of a backup / restore operation:
http://stackoverflow.com/questions/152447/is-there-a-sql-script-that-i-can-use-to-determine-the-progress-of-a-sql-server-ba
I would like to know if there's a similar query / way to see how much time the query has left until it will...
Dear all,
I would like to insert data from a file into the table Division of this model which is very much simplified:
create table Statements (
Id INT IDENTITY NOT NULL
primary key (Id)
)
create table Item (
StatementFk INT not null,
ItemNameFk INT not null,
primary key (StatementFk)
)
cr...
How to convert a column value from varbinary(max) to varchar to read..
...
What do you guys think would be the best approach here?
I have about 30 SQL tables that is basically referenced by a [lookup] table. I have to do an insert in another table [FinalTable] for each row in the [lookup] table. Now the [lookup] table looks something like this.
ID, Zipcode, tableID
1, 60453, 1
2, 90210, 1
3, 60453, ...
I am using SQL Server 2005 with Windows authentication. My login has administrator rights. For my login I have a user mapped to a database with the default schema set to "my_schema". My login is not the owner of the database. When I log on though, and try to execute a simple select statement on a table in "my_schema" without specifyi...
We have a feature that allows us to create SQL to get back data from one table based on a nested query that filters records based on matching criteria from another table. Now, we need to be able to get back data from the first table based on the top x records of the nexted query, rather than all matching records. For Example we want s...
I need to calculate the number of "active minutes" for an event within a database. The start-time is well known.
The complication is that these active minutes should only be counted during a working day - Monday-Friday 9am-6.30pm, excluding weekends and (known) list of holiday days
The start or "current" time may be outside working ho...
Hi All,
We tried using the below code snippet but showing the syntax error.
var query = (from def in entity.Defect.Where("Owner == @0", "rochs")
select def).ToList();
Thanks in Advance
...
Hi
I need to optimize my large queries for fast performance.
Is there any free tool for optimizing sql queries for sql server 2005?
...
We create multiple databases in sql server 2005. I would like to make sure that every new database that is created has a specific read only account when it gets created. I know there is a way to write code to do this, but is there a way we can set up a database template of some sort so every time a new database is created the account i...
SELECT id, EmpNo
FROM EmployeesTable
EmpNo can be the same for 1 or more records in the results of the above query. I now want to add another column derived from EmpNo(lets call it EmpNo2) but only returning distinct values of EmpNo.
For example if the above query returns 100 records but there are 69 distinct EmpNo values and i...
I have a couple of databases containing simple data which needs to be imported into a new format schema. I've come up with a flexible schema, but it relies on the critical data of the to older DBs to be stored in one table. This table has only a primary key, a foreign key (both int's), a datetime and a decimal field, but adding the coun...
I have a table that has more than 50 million records and which does not have any
partition. But now i want to add a partition scheme to this table. This table has a primary key. But i want to partition it using another int column. How can i do it?
...
Hello,
We have a Windows VPS server using SQL Server 2005 for our e-commerce site.
A while back we were suffering from attempts to access the database remotely so someone made changes so that only the IP of the server itself could access data. That was about 18 months ago and everything has been fine since.
However, we now have a seco...
I have the following data
COL-1 COL-2
1 0TY/OK
1 0TY/OK
1 0TY/OK
1 0TY/OK
1 0TY/OK
2 2KP/L
2 2KP/L
2 2KP/L
2 2KP/L
2 2KP/L
3 7U5/2M
3 7U5/2M
3 7U5/2M
3 7U5/2M
And i want to construct a select query to ret...
Hi All
What is the difference in the following mentioned things, are these used for differnet purposes or are they used collectively for some functionality, can anyone please differentiante among these based on their functionalities:
1) SqlCacheDependencyAdmin.EnableNotifications(ConnStr)
2) AspNet_RegSql.exe -S "ServerName" -d "...
I have this parent-child relationship
Paragraph
---------
ParagraphID PK
// other attributes ...
Sentence
--------
SentenceID PK
ParagraphID FK -> Paragraph.ParagraphID
Text nvarchar(4000)
Offset int
Score int
// other attributes ...
I'd like to find paragraphs that are equivalent; that is paragraphs tha...
I'm trying to a big insert of records into a table that is fulltext indexed. I have change tracking set to auto.
The records are inserted from another table, in numbers typically about 50,000 at a time. On SQL Server 2008 this takes something like 5 seconds to complete. But running on our live 2005 environment this takes upwards of 10 m...
I have a table of login events coming from Active Directory. One type of these events are machine logins, which include the IP address of the machine doing the login. This is handy, since it provides a timestamped way to determine what machine was on what IP at a given time. I'm trying to construct a query that'll give me a timestamped l...
I am trying to execute a humongous query with close to 200 inner joins on a database. It gives me the following error
Msg 701, Level 17, State 123 Line 1
I am running the database on a Dual core 2.7 GHz machine with 2GB of RAM.
Is there any way I can get this query to execute?
...