Linking SQL Server Databases AND Data Formatting Like InputMask
Mar 11, 2004
Hi
I have two questions : 1) Linking SQL Server Databases
2) Data Formatting like InputMask
1) I want to know if there is a way to link two seperate SQL server databases (it's tables) within the same server (local server). I created one Global database - with clients, etc. tables. The reason I did it like this is that I have to handle three seperate invoices databases, but using the same clients, etc. tables to get their information from. I used MS Access like this, linking Clients, etc tables from the Clients Database with the three other Databases. It worked fine but now I need some new features like setting the InvoiceNumber to something different, eg . 04/0001 for this year and then 05/0001 for next year. My Access databases can't change this numbers - it's just a autonumber I used. I know some Visual Basic code can make a change like perhaps adding a new column like InvYear and then adding it together with InvoiceNumber to get the Invoice Number, but I want to change it to SQL Server because I want to learn how SQL Server works. I am just starting out and not doing courses.
2) The other thing is I want to know if there is some feature in SQL Server to make data input easier, like a InputMask in Access where you can let a text column be formatted as you want. Eg. for a telephone number, it can store it in the format you made; like (011) 123 4567, not like you typed it : 0111234567.
I would appreciate some help.
Thank you
Corné
View 3 Replies
ADVERTISEMENT
Aug 29, 2007
Hi, I have 2 similar databases on the same SQL server (due to licencing and customisation issues for off the shelf software).
I would like to create a third database with site specific lookup tables to map data across to site codes, to do summary queries for data reporting, and to create a single point for data access. I can't modify the 2 databases.
I have created the third database and added the necessary tables, relationships, views, etc. But, how do I link to tables in the other databases on the same server so that I can do joins in a query/view ? I have SQL Server Enterprise manager.
Thanks.
View 7 Replies
View Related
Dec 10, 2007
Dear Readers,Is it possible, like in Access, to link to tables in other SQL databases that are on the same server? I have a query that I originally had in Access that queered from multiply databases. It did this by having those other tables in the other databases linked to the database that had the query.
View 3 Replies
View Related
Aug 22, 2007
I am not a database manager, but I work with people that use databases for sales and customer service... so I am not too familiar with the code and lingo... please bear with me.
We use two databases - one is in SQL, and it is for pre-sales customer service... i.e. tracking notes, phone calls, emails, and opportunities.
The second database is in Progress, and it is for actual quotes, tracking time, labor, materials, cost, and revenue.
As of now, our sales people have to enter new customers in the SQL database, and then duplicate the information in the Progress database. It's very frustrating, because everything needs to be entered twice - name, address, phone, shipping info, etc. etc. etc... When we first started this - 10 years ago - we were told that it could all be linked.
So my question is - is it possible to link these databases together? When our sales people enter a new contact in CRM, I'd like it to be automatically entered into the Progress database. If they make a change to a phone number, I'd like that to be updated in the Progress database. Also the other way around - if a shipping address is changed in the Progress database, I'd like it updated automatically in the SQL database.
Please tell me this is possible - and easy!!! Thanks for any help you can provide at all.
Jon
View 3 Replies
View Related
Mar 28, 2007
We are considering to implement Microsoft CRM 3.0 in our (small) organization. But we already have some customer information in another system (Unit4). We want to duplicate this information to our new CRM-system. This data will be read-only in the CRM-application.
Both the applications are installed on different servers with their own SQL databases(server 2000 and server 2005)
How can we duplicate the customer information from the unit4-system to Microsoft CRM? Can we simply link those databases using ?ODBC? (I heard something about ODBC but don’t know what it really is.)
Could someone clearly explain me what we have to do to make a construction as described above. (you don't have to give me all details) Is this construction possible anyway?
Thanks!
View 4 Replies
View Related
Aug 22, 2007
Hello
Does anyone know the best way to get around this problem.
Basically, I have three servers containing the same database structure. The data is different, each pertaining to the location in question.
Speaking in laymans terms, I would like to throw all the data into a big box from the three servers so that I can get the information I need from ONE source.
A problem I foresee is primary keys. For example, let's take the patient table(I work in health) the patient_key field in table patient although unique within it's own database, is not unique across the other databases from the other sites I want to "throw into the box". I can't just add another primary key of my own because it would not appear in the other tables that patient_key does. Obviously patient_key is one of many such primary keys that share this problem.
Does anyone have any suggestions as to how to go about this problem. Is there a way to "join" these databases together, like a union command does to more than one query.
My organisation uses MS SQL Server 2000, we have no analysis or reporting services add ons.
My SQL server knowledge is ok when it comes to querying and simple stuff, but the more complex administration is all new to me. So treat me like a rookie please.
thanks in advance
Paul
View 2 Replies
View Related
Jan 18, 2007
In a database, I am creating a new db. From there, I am setting up thetables, so that I can eventually create a front end (usually access,but I may attempt to be brave and lose the shell.) Anyway, I want touse a table, read-only for a lookup. It exists in another database onour system. Is there a way for me to link it into this database that Iam working on? I would think of it like in access when you go to do anew table and you choose to link the table from somewhere else. Thatis what I want to do. Can anyone possibly step me through this?I know basics of sql server and like to learn.Thanks!
View 3 Replies
View Related
Feb 18, 2006
Can Anyone Help? I have 2 Databases, Database1 and Database2.
Database1 is a content management backend database including a helpdesk and support ticket tracking table.
Database2 is a clients complete website
How do i link the tables from Database1 into Database2 so that the client can view the helpdesk thru their content management system.
(Client1, Client2, Client3 etc... will all have access to the same Database1)
Any help someone could give me would be a big help
View 3 Replies
View Related
Oct 22, 2015
I need to export some Database data into a text file. My Query looks like this:
SELECT Category1, Category2, Category3
FROM dbo.tbl1
WHERE Category1 = 'JP-4'
AND Category2> 4;
This works fine to get the data, however there is some html formatting in the table entries such as
`<p>,</p>,
,</br>` etc.
So ideally I need to remove those when exporting the data to the text file. I've tried to do it with a simple replace query but that didn't work. I've also got an issue with line splits and would need to remove the ( ).
The Data format is something like this:
Category1: JP-4
Category2: 4
Category3:<p>Neque porro quisquam est qui dolorem ipsum quia dolor</p> <p>amet, consectetur, adipisci velit</p>
Category4:<p>Neque porro quisquam est qui dolorem ipsum quia dolor</p>
I got it to work like this with the replace function:
SELECT REPLACE(REPLACE("PHOTOGRAPHS",'<p>',''),'</p>','')
FROM dbo.khia_tbl
WHERE Category1= 'JP-4'
AND Category2> 4;
But the issue is that I've got 15 columns in total and that I need to do it for several different tags for each column so
,
</br>,
as well as "" and different spaces so that would be a lot and I thought there must be a better/more efficient way of doing it...
View 1 Replies
View Related
Apr 1, 2008
I'm in the middle of developing a Database for a hospital that measures its audits, inhouse operations, and finance. What we currently have and do everyday is collect data from a large database that is real time with patient data, progess, infomation, etc and dump it into a data warehouse that runs on TSI/Eclipsys. We run reports using a number of programs and dump it into Excel sheets that have charts, reports, etc. This Database for which I'm developing won't come soley from the TSI/Eclypsys source, but this is the only source thats updated regularly. I don't want to have in sync with TSI/Eclipysys in fear that every day when it updates data may be lost, not read, or worse won't be up date if there is a problem. My question is is it possible to run a query from Sequel Server 2005 that will take that data upon request using the reporing features on Sequel Server 2005. i.e. What if I need to run a report on measure B in department 12 from Jan 1-Feb 1, instead of being in sync, can I just write queries to take that information rather than double the data and take up twice the space and trouble. FYI, these datatypes rarely change in the TSI/Eclipsys data warehouse. This sure was long question and didn't intended it to be . Thanks for listening and hope to hear back.
Stephen
View 1 Replies
View Related
Mar 10, 2008
Im currently in the process of developing a new system in ASP.net. The system uses multiple tables from a SQL database. To link information from say the products table to the suppliers table a unique key from the suppliers table is stored in the products table to show which products each supplier has bought...simple so far.
From this I can then pull out any of the information relating to that product instead of just displaying the ID. Currently this is done by creating a stored procedure and then dragging the stored procedure onto the dataset layer to create the data adapter.
Im not 100% this is the best way to be doing this. Is it possible to simply just link the tables in the dataset layer to display a string from another table instead of an ID referencing number?!
any help on this would be much appreciated as I cant really continue untill I have sorted out the data structure problems.Thanks in advancedmowfo
View 2 Replies
View Related
Oct 4, 2001
Hi, can anyone point me in the right direction of how to sync an in-house SQL Server 7 with a remote SQL server 7.
We are a development house. We build website using SQL server 7 databases then move them up to an entirely different SQL server 7 database in a remote location.
Now, please don't laugh, currently we export all the data from the development server into a csv and import it back into the live server. As you can imagine, it's clunky, time consuming and unreliable.
Is there a way to automatically sync the two? I tried desperately to find any information but even the MicroSoft MCSE training manual on SQL doesn't say how to do this.
Any help would be greatly appreciated.
Thanks in advance.
Chris
View 1 Replies
View Related
Nov 20, 2000
How can I create a database link so that I can check data between 2 similar
SQL Server 7 databases ?
View 1 Replies
View Related
Dec 8, 2006
I know this is an easy one for most of you but this is new territory for me.
I am trying to link a production application database to an existing SMS database.
Both of these databases are SQL 2000. I have sa access to both of them.
I have an accreditation application that deals with internal processes within our active directory network. We are using SMS database collections to provide the discovery for reporting of this application database and I want to compare the collection to the existing data between the 2 databases.
For simplicity I will define them both.
Application Database we will call €śA-Database€?
SMS Database we will call €śB-Database€?
I have gone into the A-Database and gone to linked Servers under the security node in enterprise manager. I created a new linked database and selected the SQL Server option in the general Tab.
In the Security Tab I selected the €śBe made using the security context€? and used €śsa€? for the Remote login and the CORRECT sa password for the With password option.
The server options tab remain the same with €?RPC, RPC Out, & Use Remote Collation€? selected.
It appears to connect but there is not any Table or Views showing up. What am I doing wrong here and what do I need to do to link these 2 database engines so I can move forward?
Thanks,
Gene Godsey
View 7 Replies
View Related
Jul 21, 2005
hy all..How can I achieve the above ?Moreover can I retrieve data from multiple databases which are lying on different DBMSs ( like retrieving from database A which is on SQL and from database B which is on Oracle ) ?Rgds.
View 2 Replies
View Related
Jun 22, 1999
When executing an inline insert into command from isqw/w the command executes perfectly. Yet when I try to create a stored procedure with exactly the same insert into statement it will not create. It does not like the database.owner.table prefix on the selected rows. Any suggestions ??
Thanks.... Tom
View 1 Replies
View Related
Jun 3, 2001
Copy objects and data between SQL Server databases
"
Display the Select Objects to Transfer dialog box, where you can specify both objects and data to copy, if both the data source and destination are Microsoft® SQL Server™ databases. The objects you can transfer include tables, views, stored procedures, defaults, rules, constraints, user-defined data types, logins, users, roles, and indexes. You can transfer objects only between multiple instances of SQL Server version 7.0, from an instance of SQL Server 7.0 to an instance of SQL Server 2000, and between multiple instances of SQL Server 2000.
"
can I apply "Copy objects and data between SQL Server databases"
to run in two different sqlserver 2000 ( not an instance ) . what I mean is I have two different sql servers located in two different locations( I am not using an instance installation) can I still run the copy and get an identical database in both servers.
Q2. if I have two sql server 2000 with different collations (one is binary and the other is the default) will I be able to run the copy wizard and still have an identical copy of sql server in both servers.
I personally tried to run the copy wizard and IT NEVER WORKED FOR ME and I really do not know the reason.
Thanks for your input.
ali
View 2 Replies
View Related
Mar 13, 2001
Does anyone familiar with a tool or a quick way to put apostrophes and commas around some values, so they could be used in a query ? Example, if I have a bunch of zip codes such as:
10001
10003
10009
54321
89043
etc
Let's say I have a couple of hundreds of them. I need to be able to see them as -
'10001','10003','10009','54321','89043' etc
Appreciate very much your time.
Ivan
View 3 Replies
View Related
Apr 12, 1999
Hello Everyone,
I have been requested to take a number of columns and concatenate them into one column with a specifc format/layout. For example I need to take this, (noting all columns are of different datatypes:
col_1 col_2 col_3 col_4 col_5 col_6 col_7
PK #1 John Doe 123 Elm Street Anywhere NM 55660
#2
#3
etc..
...and create this on a different table (noting col_2 is of datatype "text":
col_1 col_2
PK #1 John Doe
123 Elm Street
Anywhere NM 55660
#2
#3
etc..
Can this type of formatting be done?
I know how to concatenate data and use the convert function, but how do you add in CR-LF to get the proper formatting??
Any help would be greatly appreciated.
Troy
View 1 Replies
View Related
Sep 8, 2006
I am new to php/MySQL and am working on an online manual. The data is divided into Title and Content. The title is easy as it is one line but the content is meant to be in a number of paragraphs.
The Content field is currently set as "blob" and the text comes out as just one paragraph. Wha can I do to get paragraphs etc into the text?
Thanks.
View 1 Replies
View Related
Dec 5, 2006
Hi all,
I have data in a SQL Server table of type varchar(6). Each record in the column is a number of 2, 3 or 4 digits.
e.g. 22, 130, 1000, 60 etc...
I want to update all the values in the column so that they are always 4 characters long and have leading zeros.
e.g. 0022, 0130, 1000, 0060 etc...
How could I go about doing this?
Thanks
Kabir
View 2 Replies
View Related
Feb 12, 2015
I need to generate data models of all databases for an instance. How can I accomplish this?
View 3 Replies
View Related
Feb 4, 2007
I have a requirement to pull data from several large tables residing in a Postgres 8.x (PG) database into our SQL Server 2005 warehouse every night. I have been doing this via data dumps to a file then bulk loading said file into SQL2005 but I am running into character encoding issues and newlines embedded in some of the strings which is causing the bulk loader some problems.
I would like to take advantage of the power of SSIS to move the data. I cannot find a current working OLEDB driver for PG and I cannot find an ODBC Data Flow Source in SSIS to use the ODBC driver that is available for PG so I am stuck.
If someone would be kind enough to shed some light on whether this is possible and if so where I could get the instructions on how to do it I would be most appreciative.
Thanks.
--sean
View 3 Replies
View Related
Aug 18, 2004
Hi all,
I have a question about using FOR XML and sp_makewebtask. This (see below) is a simplified example where I have a table with 3 columns, the two first columns hold varius data and the third column (Subdata3) holds duplicated data.
My question is: Is it possible to transform the hierachy of data (see "Prefered XML output" for details) when transforming from SQL to XML using either FOR XML EXPLICIT or by using some sort of more advanced sp_makewebtask template (or some other technique perhaps)? And if, how? Any help welcome!
Cheers,
Christian
----------------------
--- sp_makewebtask ---
EXEC sp_makewebtask
@outputfile = c: empoutput.xml,
@query = 'SELECT Subdata1, Subdata2, Subdata3 FROM Data WHERE Subdata3 = X FOR XML AUTO, ELEMENTS',
@templatefile ='c: emp emplate.tpl'
--- c: emp emplate.tpl ---
<?xml version="1.0" encoding="UTF-8"?>
<Data>
<%begindetail%>
<%insert_data_here%>
<%enddetail%>
</Data>
--- c: empoutput.xml ---
<?xml version="1.0" encoding="UTF-8"?>
<Data>
<Subdata>
<Subdata1>455</Subdata1>
<Subdata2>12312</Subdata2>
<Subdata3>1</Subdata3>
</Subdata>
<Subdata>
<Subdata1>435345</Subdata1>
<Subdata2>675</Subdata2>
<Subdata3>1</Subdata3>
</Subdata>
<Subdata>
<Subdata1>133323</Subdata1>
<Subdata2>976</Subdata2>
<Subdata3>1</Subdata3>
</Subdata>
</Data>
--- Prefered XML output ---
<?xml version="1.0" encoding="UTF-8"?>
<Data Subdata3="1">
<Subdata>
<Subdata1>455</Subdata1>
<Subdata2>12312</Subdata2>
</Subdata>
<Subdata>
<Subdata1>435345</Subdata1>
<Subdata2>675</Subdata2>
</Subdata>
<Subdata>
<Subdata1>133323</Subdata1>
<Subdata2>976</Subdata2>
</Subdata>
</Data>
View 1 Replies
View Related
Jun 27, 2007
Hello,
I'm looking for solutions to a formatting problem.
I have two stand alone textboxes on a report body that I would like to have display side by side with very little white space between them.
Example: TextBox 1 contents (variable length) = "Muddy Waters"
Textbox 2 contents (variable length) = "B.Sc"
Current display: Muddy Waters B.Sc
Desired display: Muddy Waters B.Sc
Here is my problem.
Simple concatenation of values into 1 textbox would work if the font size and font family were the same for both textboxes; unfortunately this isn't the case. The font size and family for each textbox is different. Is there a richtext control I can place on the report and load with preformatted rich text?
Any suggestions would be appreciated.
Thanks,
Roy M
View 5 Replies
View Related
May 9, 2007
Hi,
I am having one query regarding data transfer using SSIS. If we use
DTS packages for the data transfer between two databases then the source database and
destination database must be on different db servers or instances.Here, I
am talking about the DTS Packages with Distributed Transactions enabled.
I need to know that whether this constraint has been rectified with SSIS Packages or it still persists.
One more thing is that while transferring the data, can we view/insert/update source database or it is locked if the transfer is in process.
Please reply..........
Thanks and Regards,
Rajesh
View 5 Replies
View Related
Jul 17, 2001
Hi, How would I convert(or format) money data type, so the output will be like: 123,456.78 or 12,345.67
(In other words how would I insert a comma which separates hundred from thousand...)
Thanks a lot,
Andy
View 1 Replies
View Related
Apr 3, 2014
I am working with extracting data from a SAP database, and I would like to perform some 'visual formatting' on the returned data. Because the SQL code that I am writing will be used in a custom Report it is not possible for me to use '3rd Party' formatting tools. Furthermore because the database is hosted on an MS SQL 2008 R2 RDBMS it is not possible to use the IIF() function.
Here is a sample of the data that I am getting back at the moment. URL...Here is how I would like the data to be returned (with the exception that the blue lines will ideally be blank cells). URL...
I have come to believe that I should be using the ROW_NUMBER() function, along with the OVER() function and possibly the 'partition by' keywords.Here is my original code -
Code:
select
td.ItemCode as 'Item Code'
, td.Dscription as 'Item Description', td.Quantity as 'Order Qty'
, titm.OnOrder as 'PO Qty'
, th.CardCode as 'BP Code', th.CardName as 'BP Name'
, th.DocNum as 'Sales Order Number'
, tsp.SlpName as 'Sales Person'
, twhs.WhsCode as 'Whs Code'
, isnull(tbloc.BINLABEL, '') as 'BIN Label', isnull(cast(tbloc.QUANTITY as nvarchar(20)), '') as 'BIN Qty'
code]...
Notice above that I only see the 'Seq' and no other data. How can I go about modifying this code so that I see all of the data columns I desire? If I further 'refine' the above, by adding case statements and the individual columns that I want to see (as opposed to using the * wildcard) I get a long list of error messages.
View 9 Replies
View Related
Oct 9, 2014
I need to return a single column (Name.company) but I want the data returned to be viewed in multiple columns.
First is that possible? Second if so how?
My data looks like this:
University X
University X - 1
University X - 2
University X - 3
College X
College X - 1
College X - 2
College X - 3
Cmty College X
Cmty College X - 1
Cmty College X - 2
etc.
How can I get it to return only:
University X
College X
Cmty College X
View 20 Replies
View Related
Jan 23, 2007
I have a matrix where i'm trying to have the report select the maximum value in the data area (not including the subtotals) and bold that value.
month
day1
day2
day3
day4
total
Jan
10
15
5
12
42
Feb
5
8
3
11
27
Total
15
23
8
23
69
I'm sure i will have to use the IIF function in conjunction with the InScope function.
However i'm unsure on how to isolate to the max value and make sure the Inscope function does not affect the totals.
any idea's are appreciated.
View 3 Replies
View Related
Jan 2, 2008
Okay, I know this is a very simple question, but here it is.
I have a select statement that returns a value such as: 9902.7400000000.
In the select statement it just selecting Value. In the select statement, can I format the output to be with just two decimal places? I know I should know the answer to this and how to do it, but thank you for any help.
View 3 Replies
View Related
Sep 2, 2007
I'm writing my first web site using VS 2005 and with my login page I'm trying to link with my SQL database using the following setting in my web.config file
<appSettings> <add key="SQLDB" value="server=STEVE-LT; database=MasterDB; uid=sa pwd="/></appSettings>
Then in my Login.aspx file I use the following code to access the SQL database
Dim Sc As SqlConnection = New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("SQLDB"))Dim SqlCmd As SqlCommand = New SqlCommand("Select Password, Name from Login")SqlCmd.CommandType = CommandType.StoredProcedure
Sc.Open()SqlCmd.Connection = Sc
This raises the following error message
A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)
Could someone please tell me where I am going wrong. Thanks
View 2 Replies
View Related
Mar 8, 1999
I can't seem to link a 6.5 database from 7.0 and there's nothing in help which seems to help. Is it a "SQL Server" or do you have to use the OLE DB Provider? If the latter, what's supposed to be in the Product, Data Source, Provider String and Catalog fields? What about security? I've tried everything I can think of and can't get it to work. I also get errors creating a new DTS package that says "Could ot create Component Categories Manager", and then "Error during creation of DTS Package". I installed the desktop version of 7 on an NT Workstation. Has anyone successfully linked a 6.5 server in this environment?
View 4 Replies
View Related