The project I'm currently working on involves combining data from one SQL Server 2000 databases and XML returned from a web service into a 3rd SQL Server 2000 database.
This process must be scheduled to happen once a day. If it weren't for the Web Service, I'd say that this is a no-brainer and I'd use DTS. However, I'm not sure if I can even access a Web Service with DTS. Has anyone done this or have any tips?
we have some reference tables in in a specific database. that other applications need to have access to them. Is it possible to create a view in the application's database to retrive data from ref database while users just have access to the application Database not the view's underlying tables?
Hi guys, When I thought everything is okay with this script, I got a new problem... I have a VBA's script from Excel 2003 that builds sql script and retrieves data from SQL SERVER 2000. in order to make the sql running, I need to use a multi - batch processing, to pass and execute every command line once a time.
Up to here, I am using a test case with Account number = '123456' and getting the desire results. The code below is running okay with the test case, but when changing the account number (mark as yellow in the code) to include all the accounts (or just one other account), I am getting the following ERROR: run - time error '-2147217871 (80040e31)' - [Microsoft] [ODBC SQL Server Driver] time out expired.
Now, if I take the same code, with the condition that generates the ERROR, and try it into SQL Server, I get the results without errors. Thanks in advance, Aldo.
Below the code:
Code Snippet Function QuerySalesAging() '-------------------------------------------------------------- 'MUST !!! References: Microsoft ActiveX Data Object 2.1 Library '--------------------------------------------------------------
Dim ConnString As New ADODB.Connection Dim RecordSet As New ADODB.RecordSet
'Report Criterias Criteria05 = " AND " & "Accounts.ACCOUNTKEY Between " & AccountKeyAsRange ' -- ==> With AccountKeyAsRange = '123456' AND '123456' it works okay. ' -- ==> With any other value, in example AccountKeyAsRange = '123456' AND '9999999999' it get's ERROR.
CmdLine01 = " USE " & CompanyName
' Check and drop temporary table TemporaryTableName = "CTE" ' The table is a regular one CmdLine02 = " if object_id('" & TemporaryTableName & "') is not null exec('DROP TABLE " & TemporaryTableName & "') "
CmdLine03 = " SELECT ..." CmdLine03 = CmdLine03 & " INTO " & TemporaryTableName CmdLine03 = CmdLine03 & " FROM ..." CmdLine03 = CmdLine03 & " WHERE " & "(" & Replace(Criteria05, "AND", "") & ")" CmdLine03 = CmdLine03 & " ORDER BY ..."
I want to retrieve SQL 2000 Encrypted Column Data From SQL 2005 strored proc. My Stored Procedure was on SQL 2000 and it works fine....Then I restore Database From SQL 2000 to SQL 2005. The Following Statement is on my store proce.
select user_id , Encrypt(user_pass) from OpenRowset('SQLOLEDB','myserver';'sa';'mypass',databasename.dbo.users) as a
The Following Error I get When I execute the above statement.
Msg 195, Level 15, State 10, Line 1
'Encrypt' is not a recognized built-in function name.
I have looked on google and haven't found a query (as of yet) to perform this function.
Essentially I am using VB.NET with Excel and have a mapping between a worksheet and a table in my database. I wrote an import function to pull the data out of excel and put it into SQL Server but I want to try catching errors before i do that.
What is the SQL query to get column sizes from a table. Meaning in a table I have column1 that is allowed a size of int(5). How do i retrieve that information from a query opposed to just looking at it in SQL Server EM??
Last night I face performace problems in web site. I got like 100 000 users and site fails because of sql-connections. Currently I'm making a new connection for every query, and my code looks like this:Public Shared Function executeQueryReturnDataset(ByVal strsql As String) As DataSet Dim sqlConnection As New SqlConnection(Connstr) Dim sqlCommand As New SqlCommand(strsql, sqlConnection) Dim sqlDataSet As New DataSet
Try sqlConnection.Open() Dim myDataAdapter As New SqlDataAdapter myDataAdapter.SelectCommand = sqlCommand myDataAdapter.Fill(sqlDataSet) Catch e As Exception Console.Write(e.ToString()) Finally sqlConnection.Close() End Try Return sqlDataSet End Function I was wondering would it be better to save an instance from connection object to memory and use that same connection for all querys?
Let us suppose that there are 900 rows in One table, and that table contains neither primary key, nor Identity column. How can I retrieve all the roows from 201 to 250?(like the middle limits) In oracle there is a property called RowID, but is there any such item in SQL server?
I am developing a commercial solution for scheduling problems, using different databases. Several of our clients don't have a database server installed in their systems networks, so we thought we would simply use SQL Server Express as a no-cost solution. However, I have come across a MAJOR difficulty: When I try to log on using SQL Server Authentication (for example, name: "sa" pass: "sa") instead of Windows Authentication, I am simply unable to view any data that does not come directly from a table! No data from queries(!), no data from stored procedures(!!), no data from functions(!!!), only from tables!!!! And it's not like the queries don't return a dataset, because they do, for a user logged on using Windows Authentication! And this is not 'simply' a problem of remotely connecting to SQL Server Express, this is also true locally! There is nothing wrong with my own system, this problem occurs on at least four different windows platforms, vista included. And it is not related to our program, I am having the same difficulty with the Management Studio Express. I have tried to use several different users, each with different permissions and roles, to no avail. This is truly a frustrating problem. It can be solved in one of two ways: 1. Get a non-windows-authenticated user to see the data (get more than 0 rows in the dataset). 2. Manage to log on remotely using Windows authentication.
I am unable to do either one of those, and not for lack of trying. I have been at this for the past week without results.
I need to retrieve data from a SQL-server table using a stored procedure. I want to retrieve the values from the table and add them to labels on a form. What is the easiest way to do this? Is dataset the solution?
I'm writing VB 6.0 codes to retrieve data from SQL Server 7.0. if the sql code is embedded in VB, everything works fine. But when I tried to use stored procedure, one error called "invalid object name 'author'" occurs. author is a table in my database and obviously is in the database. what's wrong?
In SSRS 2005, I have an assembly(dll) which is included in a report in order to retrieve data ( OdbcConnection) from database as special condition while the runtime of report. This assembly works FINE in the preview of VS development tools. But it is NOT working when deploying to server, it ONLY returns default value instead of database's value.
I know how to use Linked server query to retrieve data from two different sql on premise instances.I would like to try the same on sql server instances hosted on azure.When I connect to sql instance, I don't see ServerOBjects->Linked server. I just see Database and security.Is this possible on sql azure, if so how can we achieve it
'Server: Msg 7416, Level 16, State 2, Line 1 Access to the remote server is denied because no login-mapping exists'
when i run the below code,
SELECT a.* from OPENROWSET('SQLOLEDB', 'Data Source=SA3KNX; Integrated Security=SSPI; Initial Catalog=[Mis Mart]; Persist Security Info=False; Initial Catalog=Mis Mart;', 'select * from [Mis Mart].dbo.Dim_Cus') as a
Can you please help resolve this. The server SA3KNX uses windows authentication and I run this code in another serer 'SEBDTD3' which uses SQL server authentication. How can i retrieve data from a server that uses windows authentication.
Hi, I am trying to edit some data from a SQL2000-datasource in ASP.NET 2.0 and have a problem with a column that has bit-data and is used for selection. SQL2005 works fine when declaring <SelectParameters> <asp:Parameter DefaultValue="TRUE" Name="APL" Type="boolean" /> </SelectParameters>When running this code with SQL2000, there are no error-msgs, but after editing a record the "APL"-column looses its value of 1 and is set to 0. Looks like an issue with type-conversion, we've hit incompatibilities between SQL200 and 2005 with bit/boolean several times before. So, how is this done correctly with SQL2000? (I've tried setting the Type to "int16" -> err. Also setting Defval="1" gave an err) ThanksMichael
Hi, I worked on a project in ASP.NET using SQL server 2000 as the back end. Its a conversion application that I rewrote in ASP.NET using C#. I need to import the old data in Access db into SQL server 2000 and I have very little knowledge about doing it. The data in not a direct one -one transformation. There are considerable changes to the Database design and data types. Any help and suggestions wud be really helpful. Also, any article links wud be great.
I'm trying to figure this out I have a store procedure that return the userId if a user exists in my table, return 0 otherwise ------------------------------------------------------------------------ Create Procedure spUpdatePasswordByUserId @userName varchar(20), @password varchar(20) AS Begin Declare @userId int Select @userId = (Select userId from userInfo Where userName = @userName and password = @password) if (@userId > 0) return @userId else return 0 ------------------------------------------------------------------ I create a function called UpdatePasswordByUserId in my dataset with the above stored procedure that returns a scalar value. When I preview the data from the table adapter in my dataset, it spits out the right value. But when I call this UpdatepasswordByUserId from an asp.net page, it returns null/blank/0 passport.UserInfoTableAdapters oUserInfo = new UserInfoTableAdapters(); Response.Write("userId: " + oUserInfo.UpdatePasswordByUserId(txtUserName.text, txtPassword.text) ); Do you guys have any idea why?
Good day., please help me,in a formview control, i set it in Insert Mode, so it should display info from table 1 but when i click on the insert button, it will insert it in table 2.btw, table 1 and table 2 are in the same database?? how about if they are not in the same database?how?please help me,Thanks.,SALAMAT PO.,
Hey All, I am developing a data acquistion system which monitors the amount of energy that a user consumes in different parts of a house and displays the information in real time on their computer screen. I am collecting the data through tranducers attached to the circuit breakers in the breaker box and sending the data to analog-to-digital converter channels in a MCU. I am retrieving the data from the serial port and storing it to a text file. Each line of data in the text file represents three fields which are separated by commas. I will be reading data from multiple data collection boxes so the first field is the unit number, the second fied represents the analog-to-digital converter channel number from each unit, and the third field is the data that is collected from the ATD channel. I am trying to use SSE to retrieve the data from the text file, and parse each line of data into individual columns in a databse. Then I want to be able to extract the data associated with a particular ATD channel number from the databse and display it in the appropriate text field on a windows form. I've got the MCU programmed. I have no problem collecting the data from the serial port, and I can do the visual basic programming okay. I have absolutely no clue how to read the data into the database, continuosly read new values into the databse, and then access the stored data to update the text fields on the form. Please help if you can, I've been working on this specific problem for a couple of weeks and I'm not making any progress. Thanks.
Can someone please tell me how to retrieve/query the list of fields from an entity of a report data model that has been published on the reporting server programmatically ?
I am trying to upload a report data model to the reporting server and planning to use that model as the data source and consume it through our existing web application?
Hey All, I am developing a data acquistion system which monitors the amount of energy that a user consumes in different parts of a house and displays the information in real time on their computer screen. I am collecting the data through tranducers attached to the circuit breakers in the breaker box and sending the data to analog-to-digital converter channels in a MCU. I am retrieving the data from the serial port and storing it to a text file. Each line of data in the text file represents three fields which are separated by commas. I will be reading data from multiple data collection boxes so the first field is the unit number, the second fied represents the analog-to-digital converter channel number from each unit, and the third field is the data that is collected from the ATD channel. I am trying to use SSE to retrieve the data from the text file, and parse each line of data into individual columns in a databse. Then I want to be able to extract the data associated with a particular ATD channel number from the databse and display it in the appropriate text field on a windows form. I've got the MCU programmed. I have no problem collecting the data from the serial port, and I can do the visual basic programming okay. I have absolutely no clue how to read the data into the database, continuosly read new values into the databse, and then access the stored data to update the text fields on the form. Please help if you can, I've been working on this specific problem for a couple of weeks and I'm not making any progress. Thanks.
I need to retrieve points column from my database for the specific user that is signed on and sum all of them. How can I do it using the Gridview and also code in vb for a label? Thanks.
Here is my sql procedure: ALTER PROCEDURE dbo.SoftWareShow /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @SoftID uniqueidentifierAS SELECT [SoftID], [SoftName], [SoftJoinDate], [SoftSize], [SoftMode], [SoftRoof], [SoftHome], [SoftDemo], [SoftFirstClassID], [SoftSecondClassID], [SoftDesc], [SoftReadCount], [SoftDownCount],ltrim(rtrim([SoftUrlOne])) SoftUrlOne, ltrim(rtrim([SoftUrlTwo])) SoftUrlTwo, ltrim(rtrim([SoftUrlThree])) SoftUrlThree, ltrim(rtrim([SoftUrlFour])) SoftUrlFour FROM [SoftWare] WHERE ([SoftID] = @SoftID) RETURNwhere I retrieve data using sqldatasource, an error appear. how can do ?
Before I ask a question, I am visually impaired and cannot read printed words only on a screen. I am 51 years old and have been coding professionally since I was 23 (yes that long). I have four apps on the market and run a small consultancy company in the UK and my SQL knowledge is scant. I have read two books on the subject and thought I had an idea on how SQL works.
I used to belong to another forum but they gave me a hard time so please go easy on me.
I developed an ADO app ages ago and remembered some of it ...
I have four tables (the following is a simplified version of the real thing)
MainTable (Contact data like name address etc. 23 fields) Towns (Two fields TownUIN and TownName) Counties (Two fields CountyUIN and CountyName) Countries (Two fields CountryUIN and CountryName)
My database is normalised to 3NF and contains no duplicate or redundant data.
My problem ...
Sample data
Main: MainUIN MainName MainTown 1000 Fred Bloggs 1 1001 Fred Smith 2
Towns: TownUIN TownName 1 Bradford 2 Leeds
SELECT MainName,MainTown FROM Main WHERE MainUIN=1000 returns 'Fred Bloggs' 1 (the TownUIN)
I want ... 'Fred Bloggs' 'Bradford'
It was suggested I use SELECT MainName,MainTown FROM Main,Towns WHERE MainUIN=1000 AND TownUIN=MainTown This returned 'Fred Bloggs' 'Bradford' but was slow.
My question is what am I doing wrong?
I am using SQL Server 2005 Express with VB.Net 2005 on Vista Business and XP.
I am sorry my SQL knowledge is weak please dont get angry just tell me the basic thing that I do not know.
Hi.I have a IIS server with php3 installed. I have SQL server databaseand data stored in unicode format (nvarchar fields). In header of myphp I have the meta: <meta HTTP-EQUIV="content-type"CONTENT="text/html; charset=UTF-8">.I have the following problem:- I trie to do a query using ODBC (version 3.525.1022.0) and SQLServer odbc driver (version 200.85.1022.00). The query doesn'tretrieve information in utf format and accents and extra charactersaren't showed correctly.- I trie to di the query usin native OLE DB. I use mssql funtions andthe problem is the same.If I install php4 and I use "newCOM("ADODB.Connection",NULL,CP_UTF8);", then it works correctly.Anybody knows if its posible to retrieve data from sql-server in utf-8format using php3?I see in other postings that odbc driver only accept utf-8 in version3.7 or higher? Is it true? If is true, where I can download odbcdriver 3.7?Thank's in advance.Miki.
i need to retrieve data from a particular field of the gridview according to the selected row to stored it into session .....what i had done so far as following: Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) DetailsView1.PageIndex = GridView1.SelectedIndex Session.Add("receiverName", GridView1.??????) End Sub????? is the part i am not sure what to code.... i tried different method by seems to have problem of convertion.
Okay, I used the SQLDataSource control to get my data from the database table. What or how do I retrieve individual data from the sqldatasource? I want to do some string comparison and manipulation before I display it to the browser. How can this be accomplish?
Hi, I have a website which is designed to search for employee information. I have the search system working which does exactly what I want to, but as an added feature I want there to be a button which, when someone clicks on it, it takes whatever the previous search was and generates a set of data in XML format which is based on the results. For example: User searches for all entries with Forename = John; Results are listed in a gridview as per expected. User then presses button with XML on it, and page pops up with just the XML output on it, i.e. whatever results are on the gridview but in a nested XML format <records> <record> <Forename>John</Forename> <Surname>Smith</Surname> <Email>j.smith@blah.com</Email> <Ext>1234</Ext> <DeptList>History</DeptList> </record></records> I have created a stored procedure which will take the parameters from the search boxes and return the above information, but I don't know if this is the best way. Here it is for those interested: CREATE PROCEDURE ps_record_SELECT_NameSurnameEmailExtDeptasXML @Forename varchar(50), @Surname varchar(50), @Email varchar(50), @Ext varchar(4), @DeptList varchar(50) AS SELECT Forename, Surname, Email, Ext, DeptList FROM dbo.record WHERE Forename LIKE COALESCE(@Forename,Forename) AND Surname LIKE COALESCE(@Surname,Surname) AND Email LIKE COALESCE(@Email,Email) AND Ext LIKE COALESCE(@Ext,Ext) AND DeptList LIKE COALESCE(@DeptList,DeptList) FOR XML AUTO, ELEMENTS If someone could be kind enough to help me out with this, I'd be really grateful. Many thanks, Tom
Background:I am using Visual Studio 2005 Standard SP1 to create an ASP.NET website that accesses an SQL 2005 database. I am using vb.net as well.I am passing an ID in a query string from one page to the next, where I retrieve it using an SQLDataSource. The data will only be one row; it is returning customer information.Problem:I need to be able to get specific fields from the SQLDataSource and populate some textboxes. Honestly, I'm not really sure where to begin. For the sake of argument, let's say that I am working with this:'My TextboxDim LastName As Textbox'My SQLDataSource (filtered by query string using the customer's ID to only get 1 customer's information at a time)SQLDataQuestion:So, how would I go about retrieving the lastname field from SQLData and inserting it into the textbox LastName?Thanks, J'Tok
Dears, I'm using FormView to insert and retrieve data from SQL Server Database 2000. I'm using stored procedure to insert and display data by using C#. Every time I insert the data, I can't retrive it. To retrieve all the inserted data, I have to close my website, and then reopen it again. I close the connection every time after using the stored procedures, but nothing happened. What do you think the problem is ??