w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
copy folder to multiple servers with different %userprofile%
if the user is running it then this should mirror the source to the target folder, making them identical. @echo off robocopy "\NAMEOFMACHINEC$UsersMAIN USERFavoritesLinks" "%USERPROFILE%FavoritesLinks" /mir

Categories : Windows

switching svn working copy to commit to two different servers
While using branches on the single server is more manageable way, you can have two repositories and switch between them, as requested Create full dump of Production (svnadmin dump PROD-PATH > DUMPFILE) Create DEVEL repo (svnadmin create DEVEL-PATH) Load dump of PROD to DEVEL (svnadmin load DEVEL-PATH --force-uuid < DUMPFILE). --force-uuid is mandatory in order to have the same UUID in both repos (thus allowing to relocate single WC between repositories), "svnadmin create" assigned unique UUID to DEVEL Relocate WCs to DEVEL Code-commit-test... In order to return code back to PROD Get clean WC, updated to the DEVEL HEAD Relocate WC to PROD Update WC to the PROD HEAD, merge changes Commit all changes accumulated from DEVEL in WC, as one "big bang" commit to PROD Go to to part I, s

Categories : Svn

Copy files across servers in a weekly basis
I have managed to create a script that will restore the database to the remote server. mysqldump -u username -ppassword database_name | mysql -u Username_remote -ppassword_remote --host=remote_server_IP -C databse_name >> ``date "+%Y-%m-%d".log` This is not the best way to do this and not recommended in live servers.

Categories : Mysql

Copy table data without linked servers
It sounds like your only option is to ask corporate to build you an SSIS package to do the data transfer, and then have them schedule it as a SQL Server Agent job to run once a week. An SSIS package with a .dtsx file extension is what the Import/Export wizard would have saved, if you had permission to save a file on the database server. However, IT will probably build this from scratch in Visual Studio / BIDS, and it will take them much longer to document the requirements, etc, etc, than would have taken you to just save the package.

Categories : Sql Server

Joining tables across multiple servers
Yes, assuming the account has appropriate permissions you can use: SELECT ... FROM A.table t1 JOIN B.table2 t2 ON t2.column = t1.col You just need to prefix the table reference with the name of the database it resides in.

Categories : Mysql

How to compare two tables on two different servers, in SSIS within one package
Add a connection manager to both servers in the solution explorer. Then add the two data sources of your desired type(OLE DB, ODBC..) to your data flow(you can add the connection manager directly in the source editor if you like). Now you should be able to manipulate both tables. It this what youre looking for? Take a look at this: Each of those sources would be a table from their respective servers. It is necessary to sort before you join. In the Merge Join editor you can pick what kind of join it is and on what you would like to join. After that you can use either a Conditional Split of a Derived column transform to filter/manipulate your data befor you create a destination task and load it back into some table.

Categories : Mysql

Update Multiple columns in sql and oracle servers
The standard ANSI SQL implementation will work with both sql server and oracle UPDATE <TABLE Name> SET Col1 = ColValue[, Col2 = Col2Value, .....]; The only thing that you have to put is a semicolon at the end of update statement, as ";" is mandatory statement terminating operator in oracle, where as it is optional in sql server. NOTE: The clauses that I put in square brackets ([]) are optional. NOTE 2: UPDATE..FROM is a properietry syntax used by SQL Server, so it cannot be accepted by oracle.. NOTE 3: UPDATE SET (col1,col2) = Col1,Col2 is a syntax supported by oracle but not by sql server.

Categories : SQL

VBA. Comparing values of columns names in two separate worksheets, copy nonmatching columns to third worksheet
If you are going to have this code within the same workbook every time, try using ThisWorkbook.Sheets("Top_Bottom") instead of Workbooks("Complete_Last_Six_Months_Q_Results.xlsx").Sheets("Top_Bottom") replicate that through your code and see if that fixes the problem.

Categories : Excel

copy columns and rows based on two criteria in two columns
Although I am not sure I understand your question, you can filter on columns H and AC by changing the field references in the two Autofilter statements to Field:=8 and Field:=29, respectively.

Categories : Excel

Merge common columns in two tables into a single set of columns
You LEFT JOIN both tables and then use CASE on Type to select from appropriate table. Here is sample for few columns, you can do it for all columns you need. SELECT c.ID ,c.Name ,c.Type ,i.Month ,i.[Total Amount] ,CASE WHEN c.Type = 'ITS' THEN its.Price ELSE tp.Price END AS Price --construct for common columns ,CASE c.Type WHEN 'ITS' THEN its.Volume WHEN 'TP' THEN tp.Volume ELSE NULL END AS Volume -- or something like this ,CASE WHEN c.Type = 'ITS' THEN COALESCE(its.Description, dits.Name) ELSE dtp.Name END AS Description -- this for description FROM Customer c LEFT JOIN Invoice in ON in.CustomerID = c.ID LEFT JOIN InvoiceItemITS its ON its.InvoiceID = in.ID LEFT JOIN InvocieItemTP tp ON tp.InvoiceID = in.ID LEFT JOIN [Descr

Categories : SQL

How to copy data from one table to another table in Diffrent servers?
Your options are: Write an SSIS package to perform the extraction and publish to another server. Configure replication to replicate the structure and data from one server to another - this depends on how often you need to ensure the tables match. Create a linked server object to the destination server, ensure you have adequate access to the destination database, and write a query to copy across the data. Export the data to a file and import into the destination table e.g. CSV, XML. Alternatively, use a compare tool (there are various commercial tools out there e.g. RedGate) to script out the data you need and import it. The Microsoft Publishing Wizard tool can be used to script out the structure of a table along with data, and is suitable for small tables.

Categories : SQL

Copy columns from one table to another
No this is not possible in one query. You could however write a pure SQL procedure to do it (by inspecting the information_schema database), but this is not trivial, and probably not worth the hassle.

Categories : Mysql

Copy columns from one sheet to another using VBA?
If you're copying the contents of a sheet in one workbook to a sheet in another, you don't need to loop through the columns. You can do something like this: Sub CopyCells() Dim srcWb As Workbook Dim tgtWb As Workbook Dim srcWs As Worksheet Dim tgtWs As Worksheet Set srcWb = ThisWorkbook Set tgtWb = Workbooks.Open("C:TempTargetbook.xlsx") Set srcWs = srcWb.Sheets("BSC") Set tgtWs = tgtWb.Sheets("BSC") srcWs.Cells.Copy tgtWs.Range("A1") End Sub If there is a specific reason you need to copy column by column, you can use this as a starting point: Sub CopyColumns() Call CopyThisManyColumns(5) End Sub Sub CopyThisManyColumns(colCount As Integer) Dim srcWb As Workbook Dim tgtWb As Workbook Dim srcWs As Worksheet Dim tgtWs As Workshee

Categories : Excel

Bulk copy to multiple tables
var names = dt.AsEnumerable().Select(o=>o.Field<string>("Name").Distinct()); var funds = dt.AsEnumerable().Select(o=>o.Field<string>("Fund").Distinct()); Once you have these 2 collections you can convert them to datatables as you see fit (Lots of suggestions about the site), then use more SqlBulkCopy to process them

Categories : C#

Copy specific columns from one DataTable to another
Copy the whole table and remove the columns you don't want. DataTable copyDataTable; copyDataTable = table.Copy(); copyDataTable.Columns.Remove("ColB"); or int columnIndex = 1;//this will remove the second column DataTable copyDataTable; copyDataTable = table.Copy(); copyDataTable.Columns.RemoveAt(columnIndex);

Categories : C#

Copy Multiple Columns over by Column name
Change your copy lines to: Sheets("3. PMO Internal View").Range(Sheets("3. PMO Internal View").Columns(aCell1.Column).Address & "," & Sheets("3. PMO Internal View").Columns(aCell2.Column).Address & "," & Sheets("3. PMO Internal View").Columns(aCell3.Column).Address).Copy This selects your columns in one step, as multiple areas like range("A:A, C:C, E:E"). the comma's are text string additions, as if you use a comma in the range command it has a different meaning.

Categories : Vba

Copy MyISAM tables from Solaris to Linux
As long as both servers are the same architecture you should be all right, otherwise you will need to use mysqldump. See: Copying MySQL Databases to Another Machine

Categories : Mysql

How to set 2 different FK from different tables on PK with 2 columns
Change your bookauther table to create table bookauther ( book_id int , auther_id int, CONSTRAINT pk_book_id PRIMARY KEY (book_id,auther_id), FOREIGN KEY (book_id) REFERENCES book(book_id), FOREIGN KEY (auther_id) REFERENCES auther(auther_id) ) Have a look at FOREIGN KEY Constraints and SQL FOREIGN KEY Constraint

Categories : SQL

Sum up two columns from two different tables
In the bottom of the sheet, use a COUNTA formula to count nonblanks from each column. |111|222|333|111|444|222|555 ------------------------------------- aaa |2 |2 |2 |2 |2 |2 |2 bbb | |2 |2 |2 |2 |2 |2 ccc | | |2 | |2 |2 | ddd |2 | | |2 | |2 | eee |2 | |2 | | | |2 COUNTA |3 |2 |4 |3 |3 |4 |3 Paste special/transpose the header row and the COUNTA row into a new sheet. Header | COUNTA ----------------- 111 | 3 222 | 2 333 | 4 111 | 3 444 | 3 222 | 4 555 | 3 Now make a pivot table with column values "Header" and sum the COUNTA formula to get your result. If you don't want to use a pivot table, paste the header values into a new sheet, remove duplicates, a

Categories : Excel

How can I copy rows from one to another table with a different number of columns
Does this work: insert into table2 (id_commodity,parameter,value,units,type,notes) select id_commodity,parameter,value,units,type,notes from table1 UPDATE: In light of additional information provided by the OP, this should be the solution that the OP is looking for: insert into table2 (id_trade, id_commodity,parameter,value,units,type,notes) select '10', id_commodity,parameter,value,units,type,notes from table1

Categories : PHP

Copy Specific Dataset Columns to Datatable
say you have to copy columns "ColumnName1", "ColumnName2", "ColumnName3", "ColumnName4", "ColumnName5" to new DataTable DataTable source = dst4.Tables[0]; DataTable dt = source.DefaultView.ToTable(false, "ColumnName1", "ColumnName2", "ColumnName3", "ColumnName4", "ColumnName5");

Categories : C#

SELECTing only one copy of a row with a specific key that is coming from multiple tables
You could group by the NonScrumStore columns, and then aggregate the other columns like this: SELECT [NonScrumStory].[IncidentNumber], [NonScrumStory].[Description], MAX( [DailyTaskHours].[ActivityDate]), MAX( [Application].[AppName]), MAX([SupportCatagory].[Catagory]), MAX([DailyTaskHours].[PK_DailyTaskHours]), [NonScrumStory].[PK_NonScrumStory] FROM [NonScrumStory], [DailyTaskHours], [Application], [SupportCatagory] WHERE ([NonScrumStory].[UserId] = 26) AND ([NonScrumStory].[PK_NonScrumStory] = [DailyTaskHours].[NonScrumStoryId]) AND ([NonScrumStory].[CatagoryId] = [SupportCatagory].[PK_SupportCatagory]) AND ([NonScrumStory].[ApplicationId] = [Application].[PK_Application]) AND ([NonScrumStory].[Deleted] != 1) AND

Categories : SQL

SQL Query to copy data from one table into multiple other tables
You have to write multiple statements, you can't address multiple tables in one statement. Good news is, it's still no big deal. First fill students and classes tables. Something like INSERT INTO students SELECT DISTINCT student_name, date_of_birth, whatever FROM your_huge_denormalized_table; Same story for classes table. Use auto_increment columns (as primary keys) to get your ID columns. On a sidenote, don't use tablenames with a dot in the name. Usually it's like databasename.tablename. You get the idea... Now that you have your two tables filled, fill the table that resolves the m:n relationship. Oh, here you won't need an ID column, just make the primary key (student, class). INSERT INTO classes_students SELECT DISTINCT s.ID, c.ID FROM your_huge_denormalized_table d INNER JOIN

Categories : SQL

Copy/Paste records in Tables that have autonumber => same ID until refresh
You're trying to paste a number into an autonumber field. First of all, can you do this in code? Secondly, do you really NEED to see that autonumber immediately? The table needs to refresh, so whether you press F5 or whether you close the table/query, either one will update the autonumber. The next time you open it, you'll see the new number.

Categories : Ms Access

Need to Join 3 Tables On Different Columns
I'm not sure I did get what you want but I think: SELECT name FROM gc WHERE google_id = ( SELECT google_id FROM c2g WHERE category_id = ( SELECT MAX(category_id) FROM p2c ) ); might be what you are searching for.

Categories : PHP

Get columns and types for all tables
You can use the object_name() function to get the name of an object from a given object_id. And you can join onto sys.types view to get the type name: select c.object_id, object_name(c.object_id), c.name, t.name from sys.columns c join sys.types t on t.system_type_id = c.system_type_id;

Categories : Sql Server

Summing up columns from two different tables
First, create a Calendar table. One that has, at the very least, an id column and a calendar_date column, and fill it with dates covering every day of every year you can ever be interested in . (You'll find that you'll add flags for weekends, bankholidays and all sorts of other useful meta-data about dates.) Then you can LEFT JOIN on to that table, after combining your two tables with a UNION. SELECT CALENDAR.calendar_date, JOINT_LOG.ClientIP, ISNULL(SUM(JOINT_LOG.BytesSent + JOINT_LOG.BytesRec), 0) AS TotalBytes FROM CALENDAR LEFT JOIN ( SELECT LogTime, ClientIP, BytesSent, BytesRec FROM FirewallLog UNION ALL SELECT LogTime, ClientIP, BytesSent, BytesRec FROM ProxyLog ) AS JOINT_LOG ON JOINT_LOG.LogTime >= CALENDAR.calendar_date AND JOINT_LOG.LogTime <

Categories : SQL

How to find MIN and MAX of two columns from TWO different tables?
something like this will work. May be there'is some better way to convert timestamp to date. select T1.AGENT, T1.FIRSTCALL, T1.LASTCALL, T2.LOGIN, T2.LOGOUT from Table1 T1 inner join Table2 T2 on T2.AGENT = T1.AGENT and to_char(T1.FIRSTCALL, 'YYYYMMDD') = to_char(T2.LOGIN, 'YYYYMMDD') see sql fiddle with example

Categories : SQL

Copy rows between tables when doesn't exist in target, but manipulate 1 value
Specify the columns that you want to insert explicitly: INSERT INTO test2 (Column1, Column2, Column3, UpdateSource) SELECT test.Column1, test.Column2, test.Column3, 'SCRIPT A' FROM ...

Categories : Mysql

Excel 2010 VBA to copy tab names to consecutive columns
This will put the names of worksheets in the tabs to the right of the Activesheet in every 3rd column of row 1 of the Activeshseet: Sub Macro1() Dim i As Long With ThisWorkbook 'exit if Activesheet is the last tab If .ActiveSheet.Index + 1 > .Worksheets.Count Then Exit Sub End If For i = .ActiveSheet.Index + 1 To .Worksheets.Count .ActiveSheet.Cells(1, (i - .ActiveSheet.Index) + (((i - .ActiveSheet.Index) - 1) * 2)) = .Worksheets(i).Name Next i End With End Sub Please note that it's a bad idea to useOn Error Resume Next in the general manner that you did in your original code. It can mistakenly mask other errors that you don't expect. It should just be used to catch errors that you do expect.

Categories : Vba

in redshift postgresql can I skip columns with the copy function
Detailed column-mappings are not supported in COPY directly, unless Amazon/ParAccel have added something extra to their PostgreSQL fork that isn't in mainline. What you typically do in this case is have a script massage/pad the data - read the CSV, transform it as desired, then send the line through the PostgreSQL connection to a COPY ... FROM STDIN command. Alternately, you might COPY the whole original CSV into a table then transform that data with an INSERT INTO ... SELECT to the real target table.

Categories : Postgresql

How to compare two columns in Excel and if match, then copy the cell next to it
It might be easier with vlookup. Try this: =IFERROR(VLOOKUP(D2,G:H,2,0),"") The IFERROR() is for no matches, so that it throws "" in such cases. VLOOKUP's first parameter is the value to 'look for' in the reference table, which is column G and H. VLOOKUP will thus look for D2 in column G and return the value in the column index 2 (column G has column index 1, H will have column index 2), meaning that the value from column H will be returned. The last parameter is 0 (or equivalently FALSE) to mean an exact match. That's what you need as opposed to approximate match.

Categories : Excel

VBA Copy & pasting adjacent columns of multiple rows
Could you explain what exactly the problem is? What do you want fixed or improved? Is something not working? Anyway, try the following: Public Sub PasteDynamicData() Dim xlMovingSheet As Worksheet Set xlMovingSheet = ActiveWorkbook.Worksheets("MOVINGAVGDATAFromKD") xlMovingSheet.Range("C4").Copy xlMovingSheet.Range("J4").PasteSpecial Paste:=xlPasteValuesAndNumberFormats, operation:= _ xlNone, SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False xlMovingSheet.Range("I4:j4").Insert _ shift:=xlDown xlMovingSheet.Range("D4").Copy xlMovingSheet.Range("m4").PasteSpecial Paste:=xlPasteValuesAndNumberFormats, operation:= _ xlNone, SkipBlanks:=False, Transpose:=False xlMovingSheet.Range("L4:M4").Insert _ shift:=xlDown xlMovingSheet.Range("i87:m87").ClearContents C

Categories : Excel

Copy specific columns based on column headers
Assuming you want to copy them one after the other (and not column "F" of sheet1 in column "F" of sheet2, etc.) Sub CopyColumnToWorkbook() Dim sourceColumn As Range With Sheets(1) Set sourceColumn = Union(.Columns("A:D"), .Columns("F"), .Columns("X"), .Columns("V")) End With sourceColumn.Copy Destination:=Sheets(2).Cells(1, 1) End Sub

Categories : Excel

Copy multiple columns using column labels NOT numbers
Logic: Use .Find to find the Column Header and then use that column number to copy. Below is an example which will copy the column which has say Joseph Jaajaa Good Read: .Find and .FindNext In Excel VBA Assumption: I am assuming that the Headers are in Row 1 Code: Option Explicit Sub Sample() Dim ws As Worksheet Dim aCell As Range Dim strSearch As String strSearch = "Joseph Jaajaa" Set ws = ThisWorkbook.Sheets(1) With ws Set aCell = .Rows(1).Find(What:=strSearch, LookIn:=xlValues, _ LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False) If Not aCell Is Nothing Then MsgBox "Value Found in Cell " & aCell.Address & vbCrLf & _ "an

Categories : Excel

Excel VBA - Import or copy columns to another worbook in a different order
You can do it by doing a custom sort. Home Tab >> Sort & Filter >> Custom Sort >> Options Then change the sort from "Sort top to bottom" to "Sort left to right". Then its just a matter of selecting which row and how you want to sort it.

Categories : Vb.Net

Find, Copy & Paste Values under Multiple Columns
Dim varColName As Variant For Each varColName In Array("Orange", "Banana", "Pear") 'Your code goes here 'In your code, replace "Apple" with varColName 'In your code, replace "AppleNew" with varColName & "New" Next varColName

Categories : Excel

Joining two tables without combining columns
You need to add an ON condition to your remark join and get rid of that CROSS JOIN. For instance you could do: LEFT OUTER JOIN remark as cp_remark ON cp_remark.id = main_party.id OR cp_remark.id = pey_party.id OR cp_remark.id = rec_party.id On a side note, a few recommendations: Don't use SELECT * unless you are writing a query for your own consumption. Your code should show you what data you are using, only include it in the result set. It is personal preference, but I have always found putting your joins on the left is a lot easier than putting them on the right. Order your JOIN in a more logical fashion, your second JOIN requires data from your seventh, try to add detail as you go. You are joining way too many tables, you don't need to join everything that has a foreign key, on

Categories : SQL

Query two tables (get max from 2 columns on 2nd table)
To find the top selling car: select top 1 c.name from cars c join sold s on s.CarID = c.ID group by c.Name order by sum(Price * SoldUnits) desc To find the car with the single biggest sale: select top 1 c.name from cars c join sold s on s.CarID = c.ID order by Price * SoldUnits desc

Categories : SQL

Insert two columns from two different tables into another table in SQL
Unless you're doing a cartesian join, you've got a mixture of explicit and implicit syntax. I would pick one or the other (being partial to explicit syntax myself): SELECT a.column, c.column FROM Table a left outer join Table b on a.column = b.column left outer join Table c on b.column = c.column or whatever works for your structure.

Categories : SQL



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.