How I can Delete 1.5 Millions Rows From SQL Server 2000, And how much time it will take to complete this task.
I dont want to delete all records from table.... I just want to delete all records which are fullfilling WHERE condition.
EDITED from a comment to an answer below.
"I fire the same query i.e. delete from table_name with Where...
Is it possible to open a .mdf database file created in Visual Studio with some external SQL server IDE like Quest Toad for SQL server? Databases created in Visual Studio are rather similar to simple Access databases in that they're a single file.
It appears external IDE's like Toad can't see the .mdf being served by my localhost's SQL ...
I can't seem to find a relevant example out there.
I'm trying to return a sub-set of a table, and for each row in that table, I want to check how many children it has, and return that number as part of the result set.
Parent Table Columns:
PK_ID, Column1, Column2, FK1
For each FK1 in result set, select count(*) from child_table.
Fina...
We have a VS 2008 web application project under development for which a local database (mdf file) was created in its App_Data folder. Now we have changed our plans and decided to use a SQL Server 2000 Database instead of the file database in App_Data.
To achieve this, I want to use DTS Import/Export wizard to move the local database obj...
How can I get the path where SQL Server 2005 is installed in a system, through SQL command?
...
When or why will one need to use Globally Unique Identifiers instead of the traditional Idenity column? Please help me understand
...
hi,
i have two applications - one is an asp.net website and the other is a windows service.
both applications are referencing my business layer (library project), which itself is referencing my data access layer (library project) that itself uses the enterprise library data application block to receive the data form a sql server 2005 d...
Is it beneficial to add an index to a column that is part of a foreign key relationship? I have two columns which will be queried frequently and already have them foreign keyed but wasn't sure if I should index them aswell, or if the foreign key creates an index behind the scenes?
...
Using SQL Server 2005 developer edition on Windows XP pro (32-bit) I notice that the check box to enable AWE (Advanced Windowing Extensions) is enabled. I have an Opteron workstation that I could easily upgrade to 8GB or more, although it is not practical to move off 32-bit Windows XP Pro for the development environment. As far as I ca...
I am trying to insert a .csv file into a database with unix linebreaks. The command I am running is:
BULK INSERT table_name
FROM 'C:\file.csv'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
If I convert the file into Windows format the load works, but I don't want to do this extra step if it can be avoided. Any id...
Is there a way to reserve or skip or increment value of identity column?
I Have two tables joined in one-to-one relation ship. First one has IDENTITY PK column, and second one int PK (not IDENTITY). I used to insert in first, get ID and insert in second. And it works ok.
Now I need to insert values in second table without inserting in...
Is there any way to convert the 2008 Report format back to a 2005 format?
I don't think I got prompted about my upgrading my reports and now I think they are in the new format. Any way to save my changes and go back a version?
...
Is there a way to automatically print a SQL Server Reporting services (2005) report?
EDIT:
We needed to print a SSRS report at a network printer programmatically. Specifically, we wanted to fire this off from a stored procedure. We are currently using likeabanshee's method, and it is working. However, we would like something more manag...
Assume I have two data tables and a linking table as such:
A B A_B_Link
----- ----- -----
ID ID A_ID
Name Name B_ID
2 Questions:
I would like to write a query so that I have all of A's columns and a count of how many B's are linked to A, what is the best way to do this?
Is...
Let's say I have two tables, "Parent" and "Child". Parent-to-Child is a many:many relationship, implemented through a standard cross-referencing table.
I want to find all records of Parent that are referenced by ALL members of a given set of Child using SQL (in particular MS SQL Server's T-SQL; 2005 syntax is acceptable).
For example l...
I'm trying to manage the size of a SQL Server 2008 log file. I have a reporting database that is loaded once a day. The Simple recovery model is the best fit as there are no transactions other than the morning load, and I can re-create those records. My goals are to have the transaction log at a fixed size, large enough that it doesn'...
We have 71 Branches, each branch have one SQL Server for Application and around 7-10 users who use AD user to login into Branch Application. They do not use any Database user. A single SQL Database user is shared by all users. Application internally manage the connectivity with AD user and in the application we have the option to give di...
I need help running a stored procedure from SQL Server in PHP. PHP is running on a Unix/Linux server. We cannot get OUTPUT variables to return in PHP. The following is the PHP code:
$conn = mssql_connect('server', 'user', 'pass');
mssql_select_db('db', $conn);
$procedure = mssql_init('usp_StoredProc', $conn);
$tmpVar1 =...
Ok, I have an application written in C#. We have data in an SQL Server. Among that data we have user accounts, which will give access to the application.
I've read around, and I know that you should salt and hash and possibly hash a bunch of times, etc. But, where do I do what? What do I send to and from the SQL Server? Exactly what do ...
I have seen various methods used when retrieving the value of a primary key identity field after insert.
declare @t table (
id int identity primary key,
somecol datetime default getdate()
)
insert into @t
default values
select SCOPE_IDENTITY() --returns 1
select @@IDENTITY --returns 1
Returning a table of identities following...