Is there a way to copy a table schema into a new table rather than having to generate a create table script?
For example, I have table dbo.MyTable and I want to copy the schema to newuser.MyTable without a script? I know you can restore into a new database from an existing database so maybe you can do this?
thanks
-c
while ( @x < 75000) begin insert into myTesttable values (@x) Select @x = @x + 1 end
2. While the script is still running, I want to know how many records are in the table. From the same query window as the script, I have run both of the following statements.
select count(*) from mytesttable witn (nolock)
select count(*) from mytesttable witn (tablock)
Instead of getting the answer immediately, they run only after the original script has completed. They seem to be "blocked". How can I get a near realtime count of the number of records in this table while the script populates the table?
Is SSIS a tool for extracting realtime data from staging to data warehouse? Realtime in my case can be loading every 15 minutes but no more than 30 minutes. I've a data warehouse which data refresh once a day and it worked fine. The data that I extract into the warehouse is from a Staging database which is realtime replication of multiple production databases. Once a day, I've to have replication pauses on staging for a couple hours to refresh the data warehouse. That's the only way so SSIS can pull the data correctly; if I've replication on while SSIS pull data, it will always copy less rows than it supposed to.
I cannot afford to have replication pauses every 15 minutes just so I can refresh data warehouse. Does anyone every have this problem? or any best practice how to do this?
Firstly I am not a programmer; and this is the first time I have used this forum I am working with some friends who have been assisting. I am developing a product that is importing data into a sequel data base, and the data is being recorded in real time but posted at minute intervals. The data is then being exported to a local flat file again at minute intervals each row containing about 50 columns. Currently the whole file is being imported across the internet and it all works fine. I am using analysis services to look at the data every two minutes. As the file grows this time becomes longer. What I want to do is only import the latter portion of the flat file, say the last 144 rows there are 1440 rows per day. What is the most efficient way to do this? Duplicated records would be a disaster. Ideally the number of rows to be collected would be variable not fixed at 1440, these rows would be added to the main table that will probably contain up to 1 years worth of data i.e. 1440 rows * 365 days with approx 50 columns. Any comments to point me in the right direction would be appreciated. Steve
Hi, Using SSIS, I am successfully importing data from excel files into a table in sql server 2005. These excel files are ALWAYS open and are being updated from external sources i.e. third party tools. After doing alot of investigations, I have reached the conclusions as follows: When the excel files are NOT being updated, then the ssis package works BUT when the excel files are being updated, then the ssis package does not work. The error is:
[Excel Source [749]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
Please note that the excel files MUST be open so that they get updated by the third party tool. AND, every few minutes i.e. 5 mins, my ssis package should import these excel files.
Question: How is it possible to load the excel data while it is being updated by external third party.
Hi, Using SSIS, I am successfully importing data from excel files into a table in sql server 2005. These excel files are ALWAYS open and are being updated from external sources i.e. third party tools. After doing alot of investigations, I have reached the conclusions as follows: When the excel files are NOT being updated, then the ssis package works BUT when the excel files are being updated, then the ssis package does not work. The error is:
[Excel Source [749]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
Please note that the excel files MUST be open so that they get updated by the third party tool. AND, every few minutes i.e. 5 mins, my ssis package should import these excel files.
Question: How is it possible to load the excel data while it is being updated by external third party.
Ther eis an excel file. This file is open all the time so the excel sheets get populated by an external third party application real time. So the data inside the spreadsheets are constantly changing. This spreadsheet is only capable of being updated with data when it is open. And I would like to import this excel data on a certain interval into sql server 2005. Tried using the import wizard but it seems the import does not work if the source i.e. the excel file is open. Is there an alternative please? Thanks
I have a product where we feed an SQL 7 DB data collected from Manufacturing. Presently, the Data transport Program is in charge of getting prepared data from machines and inserting into the DB. This design assumes SQL7 is always ready and able - which is not true due to customer queries or backups or etc. consuming resources. There is a low level buffer in system at manufacturing level if transport dies, but transport is ignorant of SQL distress, so keeps hammering DB's frontdoor. I'm looking for help in putting SQL server in charge of allowing data in - when resources are adequate. Seems I need a function that can determine server stress QUICKLY to forestall transport program and a buffer for records at the transport layer. Anyone know / done a system where SQL server CHECKS for waiting records or OK's an external program to send until told to stop? What indicates (reliably) low server resources? Anyone ever used MSMQ?
"Black Holes are proof SOMEBODY, SOMEWHERE really did have a particularly bad Y2K problem!"
I have a requirement to mirror our production database (or part/derivative of it). It is imperative that the mirrored database maintains a live copy of the production data. The data is financial data, so analysis of it requires latest prices, exchange rates etc.
One product I have looked at, and am very impressed with so far is DataMirror (www.datamirror.com). I have no idea of its price yet, as I'm waiting for a rep to contact me. In the meantime, does anyone have experience in this field with alternative products? Is there a free product that I should be looking at?
for example, if i was to change my smtp server within the rsreportserver.config file, does it automatically update in realtime the second i save it or do i need to refresh something?
any insight on this would be grateful before i do anything.
The following dbo.Tables of Northwind.mdf in my .SQLEXPRESS (SQL Server Management Studio Express) are missing: dbo.Categories dbo.CustomerCustomerDemo dbo.CustomerDemographics dbo.Customers dbo.Employees dbo.EmployeeTerritories dbo.Order Details dbo.Orders dbo.Products dbo.Regions dbo.Shippers dbo.Suppliers dbo.Territories.
But, I have these dbo.Tables in a different Database "xyzDatabase". How can I copy each of these dbo.Tables to the another blank dbo.Table of Northwind Database?
I right clicked on the dbo.Categories and I saw the following thing: dbo.Categories New Table... Modify Open Table Script Table as |> CREATYE To |> DROP To |> SELECT To |> INSERT To |> New Query Editor Window File.... Clipboard UPDATE To |> DELETE to |> From the above observation,I think it is possible to copy the dbo.Table from the one Database to the Northwind Database that needs to be repaired. Please help and advise me how to do this task or tell me where I can find the Microsoft document that gives the details of this X-copy thing.
Thanks in advance, Scott Chang
P. S. I am using VB 2005 Express to create a project to learn "Calling Stored Procedures with ADO.NET" (see Paul Kimmel's article in http://www.developer.com/db/article.php/3438221) that needs the dbo.Tables of Northwind Database and my Northwind Database has been screwed up for quite a while and needs a big repair.
Is it possible to use SSIS to synchronize the data between a Foxpro .dbf and a compatible SQL Server table on a near realtime basis?
I have succesfully created an SSIS package that will insert data into the SQL Server Table but this is only useful for migrating data. What I need is a way to insure that the data in the SQL Server table matches that in the .dbf on a near realtime basis.
Or is there a way to link from SQL Server to the .dbf (similar to an Oracle DBLink).
PeopleID in People Table is the primarykey and foreign Key in PeopleCosts Table. PeopleID is an autonumber
The major fields in People Table are PeopleID | MajorVersion | SubVersion. I want to create a new copy of data for existing subversion (say from sub version 1 to 2) in the same table. when the new data is copied my PeopleID is getting incremented and how to copy the related data in the other table (PeopleCosts Table) with the new set of PeopleIDs..
Hi allI have two tables in SqlServer with Exactly Same Structure,I want to Copy all Records fromone of them to another one.I came across to "Insert....select..." statement But i have two problem 1) I don't know any thing about Columns name!!! i just know they have same structure and as far as i know , "Insert...select..." need the Column list to operate correctly, am i right? 2) these two table have One Prinary Key column with IDENTITY feature. Any Help Greatly appriciated.Regards.
Hi i have set up two very simple tables, I want a user to be able to create a basic account ( data stored in User_Profile table with Id set as the Primery Key as Identity) I want the user to be able to be able to return to their account at a later date and then post multiple reviews of different bands they have seen at a later date. I kept the tables in my example very simple so I could get my head around the concept, but generally, I want to connect the Id (PK) value in User_Profile table to the User_Id filed in the User_Review table, so every review that user writes, will be connected directly to their Id.
Any help you could give would be fantastic a i have no idea where to start!!!
User_Profile
Id int, ( as primary Identity Key)
Name
City
Country
I have a second table called User Reviews
User_Revews
Revew_Id int , ( as primary Identity Key)
User_Id int, ( I want this to contain the Id value in the User profile Table)
Hi, All, I have agentID in product table. Now I add agentID column in transaction table. Now I want to copy all agentID from product table to transaction table based on the order_id in both table. Can you show me an example? Thanks Betty
I need to copy existing row data from one table into a new row in a different table, both in the same database. Can this be done in a stored procedure where the selected row is passed in as parameter value? Thank you,
Hello everyone, I have a local MSSQL server (I guess it's called MSDE), with some tables that I would like to use as a template for a set of new tables. I would simply like a Stored Procedure that takes these 3 tables, makes a copy of their structure (not data, since they will be empty), and name them by using a parameter given to the SP. I have made something that I thought would work, but after testing it a bit more, it seems to forget default values for the fields, which is of course not good enough :). I hope that someone can tell me how to duplicate these 3 tables, including every detail for the fields!
Hi.Like the title says - how do i do this?I was given the following example:INSERT INTO TABLE2 SELECT * FROM TABLE1 WHERE COL1 = 'A'The above statement threw the following error:An explicit value for the identity column in table 'TABLE2' can onlybe specified when a column list is used and IDENTITY_INSERT is ON.Then, after filling in all the column names in my above selectstatement I kept getting an error to the effect that the number ofsource and destination columns don't match. This is because one column"confirm_hash" does not exist in the destination table, just thesource table.could somebody show me how to get this to work?thanks!PS - MS SQL SERVER EXPRESS 2005
I want to put fields from four tables into one table. I created a new table, but how do i get the same fields from the other tables to this table along with primary and foreign keys.
I have a number of large tables (50,000,000 + rows and 30+ columns) that are refreshed once per month with data from another system. Data is first loaded into a staging table, that has an indentical strcuture to the final table, cleansed and then copy to the final table.
The current copy process is simple but inefficient:
Truncate Table <final-table> Insert Into <final-table> Select * from <staging-table>
If possible I don't want to use DTS for this and I'd like to use a batch size of around 10,000 rows to help reduce the size of the log file because I have 3 of these types of Inserts running concurrently.
What is the fatest way to copy data from one table to another, within a stored procedure using SQL 2000 on a large, clustered server that uses logging?
hai friends.............. I want to know how to copy table from one database to another in a same sql server 2005? ex : i have one table called sample1 in database db1. we want to copy it and and paste it to database db2.how can i do this explain me elaborately. regards Samuel Chandradoss .J
Hi I have 2 MSSQL databases. I want to copy some tables of DB1 to DB2. how can I do it? Also, how can I copy some columns of table1 of DB1 to table 2 of DB2? Thanks for help
What is the best way to copy a table, with the foriegn keys, primary keys and indexes, from one database to another using SQL Server 2005? In sql server 2000 I used the DTS, but in SQL server 2005 it does'nt bring over the foriegn keys, primary keys and indexes.Thanks
Hi everone,I have one table called temp and I am copying its content over to another table called final. The final table has 2 more coloumns than the temp table, 1 of which is a primary key, and the other one is calculated. What is the easiest way I can do this?Thank you for the answer.
what's the best way to copy columns from table1 to table2. i have more columns in table2 than table1, but i want to insert the data from table1 to table2 and add default values to the extra columns....
I want to update some values in a table using an update command. Lest I do something stupid and mess things up I would like to first make a copy of that table in case what I do creates some problems down the road.
We have a backup of the whole data base but I would like to make an additional copy of just this one table, just in case. It would also be nice to have just as a record of the before changes state.