Consolidate Two Data Files

Feb 13, 2007

How can I combine two data files (i.e .mdf and .ndf). We had two data file in our old server due to disk limitation. In the new server we don't have such limitation so we like to consolidate the two file in one. What is the best way to accomplish that?

Thanks

View 1 Replies


ADVERTISEMENT

SQL Server 2012 :: Query To Consolidate Data From Tables

Feb 12, 2014

I need to make a query that counts installed developer software for all our developers (from the sccm database), for licensing purposes. The trick here is that a license should only be counted once per. developer and that should be the highest version. But in the database, the developers can have different versions of the software installed (upgrades) on the same computer and they often use several computers with different software versions.

So for example: A source table with two developers

-------------------------------------------------------------------
| dev1 | comp1 | Microsoft Visual Studio Ultimate 2013
| dev1 | comp1 | Microsoft Visual Studio Professional 2010
| dev1 | comp2 | Microsoft Visual Studio Premium 2010
| dev2 | comp3 | Microsoft Visual Studio Professional 2010
| dev2 | comp4 | Microsoft Visual Studio Premium 2012
--------------------------------------------------------------------

I want the result to be:
-----------------------------------------------------
| dev1 | Microsoft Visual Studio Ultimate 2013
| dev2 | Microsoft Visual Studio Premium 2012
------------------------------------------------------

I have created a query using cursors that give me the correct result, but it's way to slow to be acceptable (over 20 min..). I also toyed with the idea of creating some sort of CRL proc or function in C# that does the logic, but a SCCM consultant from MS said that if I create any kind of custom objects on the SCCM SQL Server instance, we loose all support from them. So I'm basically stuck with using good old fashioned T-SQL queries.

My idea now, is to use a CTE table and combine it with a Temp table with the software and a rank. I feel that I'm on the right track, but I just can't nail it properly.

This is how far I have come now:

IF OBJECT_ID('tempdb..#swRank') IS NULL CREATE TABLE #swRank(rankID int NOT NULL UNIQUE, vsVersion nvarchar(255))
INSERT INTO #swRank(rankID, vsVersion)
VALUES
(1, 'Microsoft Visual Studio Ultimate 2013'),
(2, 'Microsoft Visual Studio Ultimate 2012'),

[Code] ....

View 4 Replies View Related

Can I Consolidate These Queries?

May 6, 2008

Hi I have this select:  SELECT MemberID, FirstName, LastName, City, (SELECT TOP 1 FamilyID FROM MemberFamily WHERE (MemberID = Members.MemberID)) AS FamilyID, (SELECT TOP 1 FamFirstName FROM MemberFamily AS MemberFamily_3 WHERE (MemberID = Members.MemberID)) AS FamFirstName, (SELECT TOP 1 FamLastName FROM MemberFamily AS MemberFamily_2 WHERE (MemberID = Members.MemberID)) AS FamLastName, (SELECT TOP 1 Relation FROM MemberFamily AS MemberFamily_1 WHERE (MemberID = Members.MemberID)) AS RelationFROM Members Can I change it to something like this? (I get a syntax error when I try to run it)  SELECT MemberID, FirstName, LastName, City, (SELECT TOP 1 FamilyID, FamFirstName, FamLastName, Relation FROM MemberFamily WHERE (MemberID = Members.MemberID)) AS FamilyID, FamFirstName, FamLastName, RelationFROM Members I thought I would ask first before I begin banging my head against a wall trying to do something that's not possible.Thanks!Jason 

View 3 Replies View Related

Consolidate Multiple Records

Jul 20, 2005

I have a table containing multiple records per key. eg:1 | John Smith1 | Mary Brown1 | Julie Grey2 | Danny Pink2 | Jill WhiteI need to consolidate this into a single record for each key, eg.1 | John Smith, Mary Brown, Julie Grey2 | Danny Pink, Jill WhiteI can achieve this using front end code, but am concerned this is slow.Does anyone know how this could be achieved as a procedure or SQL statement?

View 3 Replies View Related

Strategy For Upgrade To SQL Server 2005 , Consolidate And Cluster

Sep 29, 2006

Hello there,

We have about a dozen SQL server 2000 Enterprise Edition servers in house. Our goal is to set up a cluster SQL server 2005 and consodiate the existing dozen servers to a few servers for easy manage and maintainence. So there are 3 things that we want to accomplish:

1. upgrade to SQL server 2005,

2. Consolidate existing servers

3. Make a cluster server to get high availability

But I'm sure what's the right order to acheive them. To upgrade each server to 2005 and then move them to cluster server? or set up the cluster server in 2005 and restore existing dbs to the cluster server. upgrade first or cluster first? upgrade first or consolidate first? pros and cons? upgrade or backup/restore? What do you recommend? We have lots of stored procedures, views and triggers, DTS packages and some replications. Any insight will be greatly appreciated.

-Jessie

View 2 Replies View Related

Select Statement Which Enables To Consolidate Multiple Lines In Same Table

Nov 15, 2012

I am in doubt if its possible to make a select statement which enables me to consolidate multiple lines in the same table.

I have a table with a lot of companies and figures for each company.

Some of the companies owns some of the other companies in the table and in reverse, some of the companies are owned by some of the companies in the table.

I have a lot of columns, but basically the most important columns are:

Company Name, Company Mother , Company Daughter.

Each company has also a revenue column.

What I want to do is to consolidate all figures for absolute mothers e.i. companies which are not owned by another company in the list.

I therefore need a select statement which says something like:

Get the revenue of companies not owned by another company (e.i. absolute mother). Add to this, the revenue of all its daughters. Add to this the revenue of all the daughters daughters etc. until there are no daughters left.

In other words - aggregate the revenue for all the companies in the group under the name of the ultimate parent company.

I can easily select and add the revenue for the first level of direct daughters, but I dont know how many more daughters the daughters has etc.

View 2 Replies View Related

SQL 2012 :: SharePoint 2013 Hosted SSRS - Subreport Consolidate To A Single Folder

Jan 13, 2015

I am in the process of migrating 300+ reports and 200ish subreports to SharePoint 2013 hosted. I wanted to avoid the duplication of creating copies of all the subreports across 9 different folders.

View 0 Replies View Related

SQL Server Admin 2014 :: Separate Data Files / Log Files / TempDB / Backups

Jan 9, 2015

I proposed on a new server that we separate Data Files, Log Files, tempDB, Backups, etc. onto separate LUNS on a SAN with High Speed Solid State Drives.I was told that with the new technology with solid state SAN's that it would decrease performance and that it did not work the same way as it did when you had RAID 5's etc.I thought that if things were cared out correctly by a SAN Administrator they would know how to configure for optimal performance.

View 2 Replies View Related

Empty Log Files And Data Files

Sep 17, 2004

Hi!
I'm using replication with two database on SQL 2000,when begin, the log files size is 50mb and the data files size is 150mb. But now the log files size is 2Gb and the data files size is 4Gb. I would like to decrease the log files and the data files ??? How do i do this???
(I using Truncate and shrink doesn't change )
Thanks!!!

View 2 Replies View Related

Physical Setup: 1 Data File Vs Multiple Smaller Data Files

Jul 20, 2005

Hello all. Before my arrival at my current employer, our consultantsphysically set up our MSSQL 7 server as follows:drive c: contains the mssql enginedrive d: contains the transaction logdrive e: contains the data filesNo filegroups were set up and the data files consist of only 1 largephysical file. Currently, our data file is >10GB. When I was trained onthe physical aspects of sqlserver, I was told to never create physical files[color=blue]> 2048MB each. If I did, I could expect inefficient physical storage of[/color]data and slower performance (due to the OS).Our server has 2 RAID-5 arrays. Drive c: and e: are located on the firstarray and drive d: on the second. We're running Windows 4.0 NT Server SP6with NTFS.Can someone comment on the use of 1 single large data file vs. more smallerdata files?

View 2 Replies View Related

Data Access :: Users Get Wrong Data Records - Cross Coupling When Accessing Files From MVC App

Aug 7, 2015

I have an MVC asp.net application that stores many records in a table on sql server, in its own system.  used the system for 2 months, worked fine accessing, changing data.

Now that other users are logging in? there is cross coupling going on.  one user gets the data from another users sql search.

In the mvc app it had used the get async method to read the ID record from the db, i set that to synchronous.  no effect;  the user makes their own login id but that does nt matter either.

View 8 Replies View Related

Update Data From Text Files To A Data Base?

Mar 10, 2008

i am really in need of help. i have a text file consiting of some data.i want to update my database from that text file periodically say 12 hours.the text file is being updated by another server program in every 12 hours can any one help me in this case? i am lost for this scenario?? help me please.....

View 1 Replies View Related

How To Copy Data From Backup Or Data Files To New SQL Installation?

Dec 10, 2005

Hi,I have(had) an old Win2k Server server with about 30 web site databases(SQL 2000) that just went under due to hardware problems. Thankfully, Ihave backups of all the databases plus the MDF and LDF files from thehard drive.I want to move all of these sites and their data to a newer server(Win2003) running SQL2000.What's the best way to copy the database from the old server hard drive(now mounted as an extrnal drive to a local machine; I'm currentlyFTPing all of the web site directories from it to the new server)?Just upload the original data to the new server and then mount the MDFand LDF files within the new SQL server? Or do I restore the backupfiles in the new SQL2000?All of my previous data migrations have been DTS operations from onelive server to another, so no experience with either of the abovescenarios. I'll certainly have a lot more experience at one of them bythe time this weekend is through.Thanks for any help you can offer.

View 1 Replies View Related

Recovering Data From Sql 6.5 Data Files

Sep 17, 2001

I have an sql 6.5 server that has had it OS (nt4.0) reinstalled on c:.
sql was installed on d: and all of the dat files are still there, i need to recover data from one of these, i tried install on a new machine and creating a device/db with same name and then over writing the file with the old one but enterprise manager shows it as suspect and will not let me work on it.
Any assistance would be appreciated.

Dominic

View 1 Replies View Related

Data Distribution On Data Files

Nov 13, 2007

Hello

I have a database with two data files configured under primary filegroup. Both the files are set to grow automatically till the disk space is full and both the data files are in the same drive on same physical disk.
When the transactions are happening in the database,how the data is getting distributed on both data files?
Will the transactions is inserted in to the primary data file first and once that is full it will start occupying the secondary data file?. How this distribution is happening?

Thanks in advance
Regards
Arvind

View 1 Replies View Related

Log And Data Files...

Mar 14, 2007

Hello all,

I am installing SQL Server 2005 on our server and have researched with no success on how to redirect the Data Files and Log files to a different drive, e.g. D: drive. In SQL Server 2000 you specified where you wanted to place the LOG files and Data files upon Setup.

I have looked everywhere in SQL Server 2005 install and cannot find where I can tell it to place the Data and Log files. Please point me in the right direction.

Your help is greatly appreciated,

Dan

View 3 Replies View Related

Different Size Of Data Files~~

Aug 14, 2006

hi
just wondering if any expert out there can answer my question.

i got a database separate into 3 datafiles in 3 different drives.
i will name it A, B, C.
A datafile size 30G, B datafile size 15G, C datafile size 15G.
and the drive for datafile A is about full. so is there anyway i can more some of data from A datafile to other data file? or since A+B+C =60G can i make it all 20G for each one of them by any command? thanks!!! :)

View 4 Replies View Related

Backups Data Files

Jun 26, 2001

Hello Group,

I have a SQL Server 2000 database that has never been backed up. The SQL Server database can't be logged into due to an SSL Security Error, thus I can't get to the backup utilities within Enterprise Manager.

What data files do I need to backup manually and what steps do I have to take to backup these files to a tape and rebuild the server?

Thanks

Kevin Kraus

View 3 Replies View Related

Export Data From Mdf And Ldf Files

Jun 8, 2004

Hello,

My first post, I don't know much about MS SQL.

I have the .mdf and .ldf files from an MS SQL 2000 server. I don't have MS SQL server running on my home machine. I'd like to be able to extract the data from the .mdf file to something I could use on my home machine. XML would be good, CSV would be ok too, maybe even some way to import into MySQL. Any help would be appreciated, also if I've some how missed the forum faq, please point me to it.

View 8 Replies View Related

Separation Of Log And Data Files

Sep 15, 2004

I'm kind of new to sql server (but experienced in Oracle) and I've got a couple of questions I wanted to bounce off you guys.

I'm implementing a SQL server cluster right now (2 node on Win2K3, shared EMC DASD for databases). We're at the very preliminary phase of this. I did an install and had my resource group set up with all of my disks on it. When prompted for the data file drive, I gave it one, but it put all the tlogs for the 'out of the box' database on that same drive as the data files (i.e. master, model, tempdb, etc.). The doc is a little vague in some of these areas (i.e. it says separate logs and data files on different disks, but then never actually tells you how to do that).

Now, I know how to specify the default paths for data and transaction logs for any NEW database I create and that's not a problem. However, my question is, how do I 'move' the tlogs from the databases created during the install? I've tried a detach, move tlog to separate physical drive and then reattach the db, but whenever I do this, SQL server wants to create a new tlog for the db on the same old drive as the datafile. I also can't delete the original tlog from a particular database even after I've created an additional tlog on another disk.

Any help is much appreciated. I'm more or less looking for the strategy any of you might take to set up this initial phase.

View 7 Replies View Related

Multiple Data Files

Jan 25, 2005

We have a large Database (91 GB) that is currently in one large data file. Now that we have muliple disk arrays I can split that up on I would like to have a couple data files. My question is, what is the best way to split this up? Should I keep one primary file group and just create another file, or should I create a file group for indexes and put those on that? This database is used for reporting only so it doesn't really have any writes being done on it.

Thanks much.

View 10 Replies View Related

Balancing Data Between Files

Jun 15, 2006

We are storing all our SQL 2000 databases on SAN LUNs, and one of our databases currently uses a single 40GB file which is approaching capacity. If we add further files using different LUNs, the data will start being added to these new files. My questions are these: if we were to add a number of new LUNs to this database, is there a way to redistribute the existing data so it is balanced across all files in order to gain the most benefit from having multiple files, rather than just dispersing the additional fragments across the new files?
Will the optimise feature of the maintenance plan do this automatically during the index rebuilds?
Is it better to add more files to the PRIMARY filegroup, or add a number of filegroups with single files in each? We aren't looking to use filegroups for fiddling with our backups by the way.
Many thanks for any recommendations offered.

View 2 Replies View Related

Fragmentation Of SQL Data Files

Mar 30, 2004

Hi,

How do you defragement SQL database data files? Running the DBCC DBREINDEX , DBCC INDEXDEFRAG, does that minimize fragmentations of the tables and the indexes files or is it just the index files?
Thanks in advance

a

View 6 Replies View Related

Recovering Data Through *.LDF Files

Nov 16, 2007

Hi all
I'm a newbie with SQl Server But somewhere i read that SQL server Data can be Recovered through *.LDF files
now i want to know if i open a table in Enterprise-Manager and delete some records through DELETE statement or
manually, is it possible to recover those deleted records or not? if so how?

Thanks in advance.
Regards.

View 4 Replies View Related

How Data/log Files Grow

Dec 4, 2007

Hi All
i am bit confused about how data and log files grow in databases. suppose i turn off the auto grow and restrict the maxsize upto some limit but size of data/log file is less then maxsize at some stage because what i understand is size of data/log file keep changing depends upon the activities going on the database. in future if data/log file need to grow can it grow upto the maxsize without turing on the auto grow.

regards

View 4 Replies View Related

Cube - Data Files

Feb 29, 2008

Can someone help me out in telling me what a data cube is and if you have any examples I can look at?

We are in the process of using data cubes through SQL. What we are looking for is to be able to have summary of data, but if we wanted to click on a grouping we can go to the details of the data.

I just wanted to know if there was any infomation/websites I can go and look at.

Thanks,

Wendy

View 2 Replies View Related

Writing SQL Data To XML Files

Sep 7, 2005

Hi guys,I have been trying to write data from a database to XML files andalthough i have been successful in doing that, the file(s) that are madeare not of the form that I would want.I am using:SQLDataSet.WriteXml(strFileName, XmlWriteMode.WriteSchema);to generate the files where strFileName is the name of the file. Thefiles when viewed with XML Editor are seen as lines of data instead ofthe regularly generated XML where each row is one below the other. Whenviewed with WordPad/Notepad i see elements />< betweeen the dataand somehow I think this has to do something with the problem.Can someone help me with this?? Any help or suggestion would be greatlyappreciated.Thanks.*** Sent via Developersdex http://www.developersdex.com ***

View 2 Replies View Related

How To Move Data Files

Jul 20, 2005

hello,my problem is how to move data files drom drive c: to drive d: ??--MarcinS

View 1 Replies View Related

Reading Data From 2 Files

Oct 18, 2007

Hi,

My first post.


Problem:

I have 2 tables EmployeeA(Eng) and EmployeeB(Spanish) kept in seperate mdb's. I want to add the records into Sql Server 2005 table called StateEmployee.


Procedure:

1. Loop through 2 folders..one containing table EmployeeA in mdb and other containing tbl EmployeeB in diff mdb's.
2. Pick a file from EmployeeA and EmployeeB, both at the same time.
3. Count the total no of rows in both files. If equal proceed.
4. Compare the 'employeeid' of one row of employeeA to the employeeid of EmployeeB.
5. If employee id matches, load both the rows in Sql server else file it to the error table.
6. Loop through all rows simultaneously till end of row.
7. Go to next mdb.


How do i go about this step by step. I am fairly new to SSIS. I asked my other friends too but they have complex answers which i couldnt follow. Hope someone gives an 'easy to understand' solution with sample.

thanks.

View 1 Replies View Related

Data And Log Files Won't Copy

Mar 24, 2007

I copied a database using backup and restore from Sql server 2000 to Sql server 2005. I noticed the data(mdf) and log(ldf) files did not copy. when I try to do a copy and past it gives me an error: cannot copy lof: it is being used by another person or program. Close all programs and try again. Does this mean I have to stop both servers to copy between them? Please help.

View 5 Replies View Related

Bulk Insert With CSV Data Files

Apr 18, 2001

SQL Server 7.0 doesn't seem to support data files for bulk insert that have quoted text fields.

e.g.
" 1","Farmer","Joe","AAA","Smith John","",20001001,

I've tried using the format file to strip out the quotes. But, this doesn't seem to work.

My format file looks like this:
4.2
9
1 SQLCHAR 0 0 """ 0 dummy1
2 SQLCHAR 0 9 "","" 2 EmployeeID
3 SQLCHAR 0 35 "","" 3 LastName
4 SQLCHAR 0 35 "","" 4 FirstName
5 SQLCHAR 0 10 "","" 5 Category
6 SQLCHAR 0 35 "","" 6 Supervisor
7 SQLCHAR 0 5 ""," 7 OpCode
8 SQLCHAR 0 8 "," 8 HireDate
9 SQLCHAR 0 8 "
" 9 TermDate


Any idea on how I can bulk insert a data file where some of the fields are qutoed.

View 2 Replies View Related

Need To Move Data And Log Files To A Different Drive?

Jul 3, 2001

View 1 Replies View Related

Dynamic Importing Of Files And Data

Aug 4, 2000

I am new to SQL7 and I am trying to run a package that will import fixed text files in a folder and transform the data to a table. I am using a good example found in sywink.com for dynamically importing files in a directory, but I am getting an error message when there is more than one file in the folder. Also, I am able to display all the files during the loop process, but the file initially set for the source connection is the only one that transfers data. I have the close(Transform) connection checkbox option checked, and have tried other methods of closing the connection before the new source name is called, none have helped. Does anyone have any solutions to this type of problem? Or know of other methods used for my situation?
Thanks
James

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved