If TABLE2 has a data in resource 01-05 that isn't in resource01-05 of TABLE1 then I want to added it to the next free slot where ref is the unique key.
Hi All, I've got a problem transferring objects between SQL Databases. The source database is an SQL 2000 dbase, and the destination is a local SQL2005 instance. When trying to transfer I get the error: 0x80040E37 (table) does not exist at the source - but it does.
I am guessing its a schema related issue, I've tried setting the copyschema setting to true, but no joy. The copyallschemas function doesn't work with an SQL 2000 box so its set to false.
I'm inserting from TempAccrual to VacationAccrual . It works nicely, however if I run this script again it will insert the same values again in VacationAccrual. How do I block that? IF there is a small change in one of the column in TempAccrual then allow insert. Here is my query
INSERT INTO vacationaccrual (empno, accrued_vacation, accrued_sick_effective_date, accrued_sick, import_date)
hi i am running this program and its giving some problem while execution. When the program tries to create the table expt1..its says Msg 2714, Level 16, State 1 There is already an object named 'expt1' in the database.
and if i try to drop the table expt1 it says Msg 3701, Level 11, State 1 Cannot drop the table 'expt1', because it doesn't exist in the system catalogs.
How should I resolve this problem...? ==========================
AND DETAILTRANS.CONTRACT IS NOT NULL AND DETAILTRANS.CONTRACT!='N/A' AND DETAILTRANS.EXPREV='E' AND DETAILTRANS.PRELIMORFINAL='F' AND DETAILTRANS.postedDATE IS NULL ORDER BY DETAILTRANS.GMSKEy
I have a cube that is showing measures that don't exist. Let me give an example. This example will include 3 dimensions, product, location, and time. The fact table measure will be sales.
Here are the distinct values if you were to write a sql query against the dimensionl model that feeds the cube.
Product Location Time Sales A X 1/04 200 B Y 1/04 100
A X 2/04 300
In the cube, if you were to look at product by location for just 2/04, you would see:
Product Location Sales All Loc 300 A X 300 Y
All Loc B X Y
How do you get rid of the zero's or combinations that don't exist?
Error at Get Fenics data to table [Load into FFFenics table [155]]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E37. An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E37 Description: "Invalid object name 'dbo.FFFenics'.".
Error at Get Fenics data to table [Load into FFFenics table [155]]: Failed to open a fastload rowset for "[dbo].[FFFenics]". Check that the object exists in the database.
Error at Get Fenics data to table [DTS.Pipeline]: "component "Load into FFFenics table" (155)" failed validation and returned validation status "VS_ISBROKEN".
Error at Get Fenics data to table [DTS.Pipeline]: One or more component failed validation.
Error at Get Fenics data to table: There were errors during task validation.
I'm trying to create a local copy of a popular CRM database calledSalesforce.com. Many of the tables in the DB have FOREIGN KEYreferences that I want to preserve, but I've run into a chicken and eggproblem. Table "A" has a reference to table "B," and table "B" has areference to table "A." So I can't CREATE one until the other exists.Is there a way to disable these checks until I've created all theschema?Here's what I see (error first, then SQL that caused it):Server: Msg 1767, Level 16, State 1, Line 1Foreign key 'FK__UserRole__LastMo__48CFD27E' references invalid table'User'.Server: Msg 1750, Level 16, State 1, Line 1Could not create constraint. See previous errors.CREATE TABLE salesforce3.dbo."UserRole" ("Id" varchar(18) PRIMARY KEY ,"Name" varchar(40), "ParentRoleId" varchar(18) REFERENCES"UserRole"(Id), "RollupDescription" varchar(80),"OpportunityAccessForAccountOwner" varchar(40),"CaseAccessForAccountOwner" varchar(40), "LastModifiedDate" datetime,"LastModifiedById" varchar(18) REFERENCES "User"(Id), "SystemModstamp"datetime);CREATE TABLE salesforce3.dbo."User" ("Id" varchar(18) PRIMARY KEY ,"Username" varchar(80), "LastName" varchar(80), "FirstName"varchar(40), "CompanyName" varchar(80), "Division" varchar(80),"Department" varchar(80), "Title" varchar(80), "Street" text, "City"varchar(40), "State" varchar(20), "PostalCode" varchar(20), "Country"varchar(40), "Email" varchar(80), "Phone" varchar(40), "Fax"varchar(40), "MobilePhone" varchar(40), "Alias" varchar(8), "IsActive"bit, "TimeZoneSidKey" varchar(40), "UserRoleId" varchar(18) REFERENCES"UserRole"(Id), "LocaleSidKey" varchar(40), "ReceivesInfoEmails" bit,"ReceivesAdminInfoEmails" bit, "EmailEncodingKey" varchar(40),"ProfileId" varchar(18) REFERENCES "Profile"(Id), "LanguageLocaleKey"varchar(40), "EmployeeNumber" varchar(20), "WirelessEmail" varchar(80),"LastLoginDate" datetime, "CreatedDate" datetime, "CreatedById"varchar(18) REFERENCES "User"(Id), "LastModifiedDate" datetime,"LastModifiedById" varchar(18) REFERENCES "User"(Id), "SystemModstamp"datetime, "UserPermissionsMarketingUser" bit,"UserPermissionsOfflineUser" bit, "UserPermissionsWirelessUser" bit,"UserPermissionsSuperCssUser" bit, "UserPermissionsAvantgoUser" bit);
I created a simple SSIS package that takes a Flat File Source (CSV file) and Imports it into a OLE DB Destination ([TestCSVImport].dbo.Table1). I have other CSV files I'd like to import, but I don't want to import entries where column "ordereID" (PK) are the equal. Just want to import the new data found in the CSV files. I tried adding a Lookup in-between the Flat File Source and the OLE DB Destination, but I'm not sure how to accomplish only importing new data.
- INSERT INTO TABLE2 (COL1, COL2, COL3) SELECT COL1, COL4, COL7 FROM TABLE1 - what i want is i INSERT INTO TABLE2 (COL1, COL2, COL3) SELECT COL4, COL7 FROM TABLE1 Username (add one more value exp: Username)
Hi I'm new to SQL server. What I'm trying to do is to automate the import of data from an Excel spreadsheet to a table within SQL Server. The index of the table has a seed set to increment by 1 and I assume that this is the same as the Autonum datatype in Access. When I import data I miss out this field as it is autogenerated, but the DTS package fails as it is trying to put a NULL in to this field. Where am I going wrong....is there something that I should change on the DTS import?
I have a simple question I hope someone can verify for me. At my company we are sending 2 different response messages. One is a commit response and one is a finalize response. Currently the service that we are sending the responses to only cares about the commit but later on in development they will care about the finalize response. The service that we are sending the finalize message to simply does not have a finalize message type and if running the profiler on it an error occurs: "This message could not be delivered because the message type name could not be found." And the message is lost. This doesn't really matter to anyone because at the time no one cares about the message. But I want to make sure that that is expected. After all service broker is supposed to be reliable. So my question is: If a message_type doesn't exist on the target side, will the message disappear and is that normal service broker behavior. I would hate to one day find the transmission queue with thousands of messages in it.
Hi, I not sure where my connection string is incorrect. I cant' access the SQL Server through Query Analyzer but the program can't. here is my connection string."ConnectionString" value="Data Source=xx.xx.xx.xx;Initial Catalog=xxx;UID=xxx;PWD=xxx;MAX POOL SIZE=5"> In the Query analyzer, i choose the SQL Server Authentication and provide login and password. I can access the database. Also, i can access the database at local computer. But, i can't access the database by other pc throught network. do i need to provide any other in the connection string?
I have a sql command that is loaded on page load that collects information based on the query string. The query string is a random group of numbers and letters. How do I catch it and direct to an error page if the query can not be found in the database? Thanks!
Hi all: for example: testDataContext db=new testDataContext();var res=db.tables.single(p=>p.columnName=="hi"); if there is a record in the database, it works well, but if there isn't , it will throw an exception, then , How could I know the record exists or not ? I don't think exception is a resonable way. and in my opinion, there should be--------even must be ------a resonable way , to evaluate the query result to a bool variable, then program could judge the bool variable like : if(bExist) show("yes, I find it");else show("sorry, the record doesn't exist in the database"); I can't imagine I got the bool variable via exception... thanks to all..
hello can anybody help me in this issue:-i got two sets of connection string modules, let us say (1) working (2) not working, and here is the code for the two sets:-set (1) which is working fine:- private void OpenData(){System.Data.DataTable dt = new System.Data.DataTable(); // The connection string was not originally hardcoded but for some reason it was staying around when passed // in through the constructor. It was always blank. System.Data.SqlClient.SqlConnection cn = new System.Data.SqlClient.SqlConnection(@"data source=localhost;initial catalog=truckorder;Integrated Security=SSPI;"); //System.Data.SqlClient.SqlConnection cn = new System.Data.SqlClient.SqlConnection(_cnString); cn.Open(); new System.Data.SqlClient.SqlDataAdapter("SELECT * FROM dealers WHERE DealerWeb like '%" + _url + "%'", cn).Fill(dt); if(dt.Rows.Count > 0) {_dealerid = Int32.Parse(dt.Rows[0]["dealerid"].ToString());_dealername = dt.Rows[0]["dealerName"].ToString();_dealerparent = Int32.Parse(dt.Rows[0]["dealerParent"].ToString());_usedMessage = dt.Rows[0]["usedMessage"].ToString();_rentalMessage = dt.Rows[0]["rentalMessage"].ToString();} cn.Close();}----------------------------------------------------------------------------------------------------------------------------------------------------------------------set (2) not working fine:-private void OpenData() { System.Data.DataTable dt = new System.Data.DataTable();System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection ();conn.ConnectionString = "integrated security=SSPI;data source=FR011PC;persist security info=False;initial catalog=TruckOrder";
try{conn.Open();new System.Data.SqlClient.SqlDataAdapter("SELECT * FROM dealers WHERE DealerWeb like 'yalevictoria.com.au'", conn).Fill(dt); if(dt.Rows.Count > 0){_dealerid = Int32.Parse(dt.Rows[0]["dealerid"].ToString());_dealername = dt.Rows[0]["dealerName"].ToString();_dealerparent = Int32.Parse(dt.Rows[0]["dealerParent"].ToString());_usedMessage = dt.Rows[0]["usedMessage"].ToString();_rentalMessage = dt.Rows[0]["rentalMessage"].ToString(); _dealerWeb = dt.Rows[0]["dealerWeb"].ToString();}} finally {conn.Close();}THE DIFFERENCE IN BOTH THE SETS IS :- The Connection String (if you look at carefully) the one which is working has localhost and the one which is not working is having FR011PC (this code is working fine on FR011PC machine name and SqlServer Name) BUTwhen i transfer FR011PC code to the localhost machine, I mean i changed to datasource from FR011PC to localhost and run its giving me SQL SERVER DOESN'T EXIST OR ACCESS DENIED.Can any body help me on this issue has this is urgent for me please...................
Hello,few users have problems with our application(ADP/MsAcces2000+SqlServer2000). Whenthey want to open a report which source is a stored procedure, they getmessage that "record source specified..... do not exist" - of course,it's not true.More details:- other users don't have this problem- they have WinXP- all users have the same permissions to SQL objects- I've checked Microsoft KB(http://support.microsoft.com/kb/243532/en-us) and they write about"dbo." before source name - I use that, so it's not a solution. Whatmore, in application there are lists which have SP as row source andwithout "dbo." and it works. (In lists a row source is defined as:"exec <sp_name>", in reports as: "dbo.<sp_name>").- computers have all service packs, new version of MDAC, etc.- I asked another user, who doesn't have this problem on his machine,to login on "bad" machine and he couldn't open reports too.Maybe someone could help? because I don't have more ideas.
I'm having some very frustrating 'syncing' problems with my report (currently in dev in visual studio) and what actually exists in the database. To start, I had my report definition open, and realized I needed a new sproc. So I went over to the db and created a new sproc, lets call it "Test1". After making a new dataset in ssrs, I can't seem to get SSRS to realize the stored proc actually exists. I continually get the error:
"The stored procedure 'Test1' doesn't exist. (System.Data)
I've shut down visual studio, re-opened, etc. Same thing. It looks like visual studio has some cached version of sys.procedures that only refreshes when the bloody thing feels like it. Any ideas?? I've been doing this for awhile, and I've minded the connection string, correct sproc syntax, etc. It runs fine on SQL Management studio.
Another, similar problem - When adding in a new column to a sproc, the dataset doesn't seem to pick up on it, no matter how many times the "refresh fields" button is hit.
I'd like to get some ideas for the following: I am writing a quick mini-application that searches for records in a database, which is easy enough. However, if the search term comes up empty, I need to return 10 records before the positon the search term would be in if it existed, and 10 records after. (Obviously the results are ordered on the search term column) So for example, if I am searching on "Microsoft", and it doesn't exist in my table, I need to return the 10 records that come before Microsoft alphabetically, and then the 10 that come after it. I have a SP that does this, but it is pretty messy and I'd like to see if anyone else had some ideas that might be better. Thanks!
I've got a big problem that I'm trying to figure out:I have an address table out-of-which I am trying to select mailing addresses for companies UNLESS a mailing address doesn't exist; then I want to select the physical addresses for that company. If I get multiple mailing or physical addresses returned I only want the most recently edited out of those.I don't need this for an individual ID select, I need it applied to every record from the table.My address table has some columns that look like: [AddressID] [int][LocationID] [int][Type] [nvarchar](10)[Address] [varchar](50)[City] [varchar](50)[State] [char](2)[Zip] [varchar](5)[AddDate] [datetime][EditDate] [datetime]AddressID is a primary-key non-null column to the address table and the LocationID is a foreign key value from a seperate Companies table.So there will be multiple addresses to one LocationID, but each address will have it's own AddressID.How can I do this efficiently with perfomance in mind???Thank you in advance for any and all replies...
I've got a big problem that I'm trying to figure out:
I have an address table out-of-which I am trying to select mailing addresses for companies UNLESS a mailing address doesn't exist; then I want to select the physical addresses for that company. If I get multiple mailing or physical addresses returned I only want the most recently edited out of those.
I don't need this for an individual ID select, I need it applied to every record from the table.
My address table has some columns that look like: [AddressID] [int] [LocationID] [int] [Type] [nvarchar](10) [Address] [varchar](50) [City] [varchar](50) [State] [char](2) [Zip] [varchar](5) [AddDate] [datetime] [EditDate] [datetime]
AddressID is a primary-key non-null column to the address table and the LocationID is a foreign key value from a seperate Companies table. So there will be multiple addresses to one LocationID, but each address will have it's own AddressID.
How can I do this efficiently with perfomance in mind???
We have a maintenance plan running everyday for rebuild and re-organisation of indexes. But, somehow its getting failed. Here is the script that we are running for rebuild or re-org.
/* Script to handle index maintenance Tuning constants are set in-line current values are; SET @MinFragmentation SET @MaxFragmentation SET @TrivialPageCount
I am looking for a way to leave a Data Flow Task destination table name as-is, and have SSIS auto-create the table if it doesn't exist already.
I searched on this in the forums but based on the question it's difficult to kow if it has been answered or not.
Details:
I am writing some SSIS packages that need to be executable on another server. Many of the Data Flow Tasks copy data (such as from a Fuzzy Grouping transformation, and lots of other stuff) into a new table. But the other server will not have these tables set up for the first run.
My current solution is to check information_schema.tables and drop IF EXISTS. But, then the Data Flow Task will not work (becase table does not exist). So, I script to new window a create table statement based on the existing table that I use in my dev environment. This is a hack and I want to find a better method.
It is quite possible (although unlikely) that the source columns could be changed in the future, or some query used to pull the data might be modified. If this happens, then I would need to change the CREATE TABLE Execute SQL task. I want my package to accommodate without having to modify it.
When I use the Import/Export Wizard, I can select a table name from the drop down list OR type in a new name. When I type in the new name, it assumes I want to create the table. NOW, is there a way to mimic this in BI Developer Studio? Yep, I saved the Wizard version of the SSIS package and all it does is run a CREATE TABLE statement first.
I am looking for a way to leave a Data Flow Task destination table name as-is, and have SSIS auto-create the table if it doesn't exist already.
I've got a big problem that I'm trying to figure out: I have an address table out-of-which I am trying to select mailing addresses for companies UNLESS a mailing address doesn't exist; then I want to select the physical addresses for that company. If I get multiple mailing or physical addresses returned I only want the most recently edited out of those.
I don't need this for an individual ID select, I need it applied to every record from the table.
My address table has some columns that look like: [AddressID] [int] [LocationID] [int]
AddressID is a primary-key non-null column to the address table and the LocationID is a foreign key value from a seperate Companies table. So there will be multiple addresses to one LocationID, but each address will have it's own AddressID.
How can I do this efficiently with perfomance in mind???
I am using a SQL command in ASP.NET to send a query to a an OLAP cube that returns a dynamic set of data that I load into a datatable and then bind to a GridView. I have made my own ITemplate implementaton for displaying and formatting the data, and the following line is causing me problems: RawValue = DataBinder.Eval(row.DataItem, "[Month].[Month].[MEMBER_CAPTION]") The error returned is: Month is neither a DataColumn nor a DataRelation for table My guess as to what is happening is that it sees the brackets in the field name and stops reading the field name at [Month], when the actual field name is much longer. I know that it knows about the column name because it displays it correctly in the header. Since I am loading this from an OLAP cube the names of my columns vary based on the criteria so I cannot alias the column because I don't know exactly which columns will be displayed. Does anyone know how I might get the DataBinder.Eval function to work with fields that contain square brackets [ and ] ? If I use the GridView's "auto-generate fields" option it will show the data (and this is the column name) but I lose all control over formatting and the other custom code I'm writing in my ITemplate interface. Thanks
In Sql 6.5 there was an option to Transfer the db. I used this quite often to make a duplicate test db of my production db. Under 7.0 I haven't found it so easy to do this. DTS wizard hasn't worked well for me. I can get it to transfer tables but not all of the objects. Any ideas? Thanks.
We have a SQL 6.5 database that was expanded larger than was really necessary. I have created a smaller size database and am wondering what the easiest way would be transfer ALL of the data and objects from the existing database into the new one. Is SQL transfer manager reliable? Are there any better ways?
i have a couple of tables interlinked, and in one table it has a column named contact with such info in as S Smith, John Burn. and i need to split this up, so it can go into a number of other columns in another table, such as initials, name surname.
the best ive come up with so far is, isnt very good.
Hi! I am trying to import a file from excel into Enterprise Manager. I have found the wizard that does this, but I can't seem to find the table I want to import the file into. What am I doing wrong? Thanks for any help you can give.