Quantcast
Channel: SQL Server Data Access forum
Viewing all 4164 articles
Browse latest View live

Convert Row of Data in a single column in respective columns

$
0
0

Hi,

I have below table of data,

CustID    Question    Answer
1    FirstName    John
1    LastName    William
1    Country    India
1    Zip Code    60000
2    FirstName    xxxx
2    LastName    yyyy
2    Country    US
2    Zip Code    123456
3    OrgName    ABC Pvt Ltd
3    Country    UK
3    Zip Code    987654

I want to convert it in a single row group by custid and expected output should be mentioned as below,

OUTPUT DATA
Customer IdFirst NameLast NameOrg NameCountryZip Code
1JohnWilliam India60000
2xxxxyyyy US123456
3  ABC Pvt LtdUK987654

kindly let me know how can i achieve the above one.

Thanks in Advance.


ODBC from Access 2010 - where have my exported tables gone?

$
0
0

Story so far:

Environment Windows 8.1 Office 2013 both 64 bit

Got an Access 2010 DB which is too big (1.8GB), so I want to do an SQL Express back end and an Access front end.

I install SQL 2012 Express on my local system CCW8.

I create a DB in SQL Management Studio (called OUS). In Access 2013 I create an ODBC datasource (it does not ask for 32 or 64 bit) called CCW8\OUS

I can export tables to this daatsource

I delete the local tables in Access.

I attach the dbo.TABLENAME SQL tables

My data is visible.

But I need to find these tables in SQL Management Studio to do the database diagrams. I can't find them

My OUS database exists but has no tables.

After a reboot, the datasource is no longer visible in ODBC datasouces (32 or 64 bit) but the Access DB can still "see" some data

Can someone point me to a reference?

Also should I stop using Access as a front end - it's easy for users coming from Excel and Office VBA?


CarolChi

MSDTC Failure - Enlist operation failed: 0x8004d01c(XACT_E_CONNECTION_DOWN).

$
0
0

Hi,

We had to recycle MSDTC for some other reason and noticed that all transactions started failing with the below error.

Enlist operation failed: 0x8004d01c(XACT_E_CONNECTION_DOWN). SQL Server could not register with Microsoft Distributed Transaction Coordinator (MS DTC) as a resource manager for this transaction. The transaction may have been stopped by the client or the resource manager.

All these transactions were going through fine until we recycled the dtc service. We noticed in some forums that the only solution is to restart sql server service.

Curious to know -

  • What is the sql server registration process with MSDTC and what could cause this to fail?
  • Any other resolution other restarting the services ?
  • Any proactive measures to avoid this failure?


Trinity

Need a query

$
0
0

myTable

id        name          date

1         A               2012-01-02

2         B               2010-05-07

3         C               2007-11-07

4         A               2011-08-04

5         C               2011-03-14

i need a query to return one row for each name that has maximum date

id       name      date

1        A             2012-01-02

2        B             2010-05-07

5        C             2011-03-14

sql query to return all records from current month ( day lapse)

$
0
0

Hi There,

I currently have a view , and I am looking to return all records for current month, ( I propose using script below to achieve this..)..however to complicate things further, there will be a day lapse....so when the view is looked at on the 31 august...all records from 01 -30 August will be shown....on the 01 September I would again like to show all records for 01-31 August....on September 02 this should then only show records for 01 September....

I hope this makes sense...Would greatly appreciate peoples input on this.

Thanks a million....(See proposed script below.)

Aidan

SELECT Column1,...
FROM TableName
WHERE
MONTH(DateColumn) = MONTH(GetDate())
AND
YEAR(DateColumn) = YEAR(GetDate())

Hot to join 5 more table

$
0
0

Please look at this tables. How to get the data like in "Result" Table.


table 1: Invoice


Warm Regards,


Problem with MS Access 2000 runtime reports and forms to access the stored procedure in sql server 2008

$
0
0
Hi All,

I am migrating SQL Server 7 to SQL Server 2008. The front end application is developed in MS Access 2000. Users who use Access application have runtime installed on their machines and its working fine with sql server 7..........but when the same application accessing the data from SQL Server 2008 getting problem only with runtime(runtime means readonly installation........users can access application but not able to change any code) (if users had MS Access 2000 full version installed no error while accessing stored procedure from SQL Server 2008 in reports and forms) ...........any help

the error message as follows
the expression DblClick you entered as the event property setting produced the following error: The record source 'dbo.storedprocedure1' specified on this form or report does not exist.

Thanks in advanced

A connection was successfully established with the server, but then an error occurred during the pre-login handshake.

$
0
0

I get the following error when trying to view my page.

Can someone please help me with this error. What does it mean and what is the solution to it? Here is the complete error message. -

A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)


MS SQL Server Management studio error

$
0
0

I am using MS SQL Server Management studio to query a sql db and unable to connect using the Windows Authentication and get the following error message.  Can someone help me troubleshoot this please?

Login failed for user 'domain\windows username', (Microsoft SQL Server, Error: 18456).

Regards

Post Codes

$
0
0

I have a table with Part Codes (First Three Letters) in the next column I have a van number

I want to match the Post code in the customers file with the Van File with the van number in it

I have tried Left(Post Code),3 in a query on the customers file but nothing

Many thanks

Conncetion between MS SQL Server 2008 and Javascript

$
0
0
i am try to connect MS SQL server 2008 with javascript to view the table or i's content on browser. 

Server name: localhost; user id :"sa" and password:"sql90", with system database - "Master". Below have the coding i used. but is show nothing. so i want to know that what i am missing..

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Database Connect</title>

<script language="javascript" type="text/javascript">
function loadDB()
 { 
   

var connection = new ActiveXObject("ADODB.Connection");

var connectionstring="Data Source=localhost;Initial Catalog=C:\\Program Files\\Microsoft SQL Server\\MSSQL10.MSSQLSERVER\\MSSQL\\DATA\\master.mdf;User ID=sa;Password=sql90;Provider=MSSQLSERVER";

connection.open(connectionstring);

var rs = new ActiveXObject("ADODB.Recordset");

rs.Open("SELECT * FROM sys.tables", connection);
rs.MoveFirst();
while(!rs.EOF)
{
  //document.getElementById("records").innerHTML=(rs.fields(1));
  document.write(rs.fields(1));
  rs.MoveNext();
}

rs.close();
connection.close();

 }
</script>
</head>
<body>

<p>Click the button to display what day it is today.</p>

<button type="button" onclick="loadDB()">Try it</button>

<p id="records"></p>
</body>
</html>

Use Sql server and Oracle into the windows 8.1 app for desktop

$
0
0
Hello, I just wanted to know that i am going to develop windows 8.1 desktop app so can i connect this app to a server database like oracle and sql server because i am not able to connect the windows 8.1 app for windows with the server database. Thanks: Kumar Gautam

Unable to connect to SQL database through ODBC calls

$
0
0

I have been looking around for an answer to this, but haven't found the exact issue I'm seeing.

I have several Excel spreadsheets which have been working until recently, which use an ODBC call to a remote SQL database. The database is running, remote connections are allowed. The SQL server is in a domain which has no external trusts. Users with accounts in this domain can remotely access the SQl databases through ODBC just fine. Users who do not have domain accounts in this domain are being denied access by their domain account, and the SQL authentication is not passed through, even though remote access is set to allow "everyone", and the database is set to Windows authentication and SQL authentication. This worked until early this week (the spreadsheet was created in 2010), and I have been looking fruitlessly for a fix ever since. As far as I know, no changes were made to group policy on this domain, and no changes were made to the server or database recently, except Microsoft patches. None of the patches this month looked like they would affect this.

When I run my query (below) I only get 100 rows returned.

$
0
0

I am a little rusty with SQL so I think that I must be doing something simple wrong. Here is the query:

SELECT Tagname, Value, DateTime
FROM Insql.Runtime.dbo.AnalogHistory
WHERE "DateTime" > 'February 26 2014 10:30'
AND "DateTime" < 'February 26 2014 10:50'
AND Tagname = 'T0201001'

This is a wonderware plant historical database that collects analog data every 5 seconds.

No matter the time frame, 5 minutes or 5 hours I get back 100 rows of evenly time spaced data.

I went into the query options and edited them to no avail. I am sure that I could calculate how mainy rows I think that I should have and select that number but I assumed the given the date range it would figure that out by itself.

Accessing SQL Server from MS Access

$
0
0
Dear database professionals,

Please bear with me, I am not a full time database developer.

I work on a few smaller projects with SQL Server. We are using Access-mdbs as Frontends. (Are there other options for front-end technologies? Access projects seem to be deprecated, correct? What's the most popular front end used together with SQL server?)
We use linked tables, linked views, stored procedures, triggers and pass through queries. We use bound forms whenever possible.

For small projects this is sufficient most of the time and quite convenient. However if there is a larger table in the database I would like to be able to dynamically filter (depending on user input for example) the recordset on the server. Pass through queries can achieve this, but they are read-only, so I can't use them as a record source of bound-forms (the user woudn't be able to insert or edit records). Views on the other hand can be updateable but I can't dynamically change them from within access, right?

I have looked through a lot of documentation, books and forums, I have talked to people some of them pointed me to ADO, but i have to admit I am not quite sure which way to go.

I have read "Microsoft is Aligning with ODBC for Native Relation Data Access" (http://blogs.msdn.com/b/sqlnativeclient/archive/2011/08/29/microsoft-is-aligning-with-odbc-for-native-relational-data-access.aspx) talking about the deprecation of OLEDB and "Data Access Technologies Road Map" (http://msdn.microsoft.com/en-us/library/ms810810.aspx) containing this interesting graphics: http://i.msdn.microsoft.com/dynimg/IC539109.gif

According to the graphics mentioned above ADO relies on OLEDB. What happens to ADO after the deprecation of OLEDB? Please tell me what technologies will help me to achieve what I want and will be supported in future versions of SQL Server.

Thanks very much in advance, Regards W
Your advice is greatly appreciated.


Joins

$
0
0

Hi,

I have two tables Employee (Id, Name, MgrId) and Department (Id, EmpId).

I want to display the list of employees who are not alloted to any department.

I tried using Join with <> condition. But not successful.

Please help?

Thanks

Manikandan


Manikandan

verify that SQL server Reporting services is installed properly and that it is running

$
0
0

I am trying to install DPM 2012 R2 on a Windows storage server 2012. I have installed SQL 2012. I get this error message: report configuration failed. verify that SQL server Reporting services is installed properly and that it is running. what could be the problem?


Bob Lin, MCSE &amp; CNE Networking, Internet, Routing, VPN Networking, Internet, Routing, VPN Troubleshooting on http://www.ChicagoTech.net How to Install and Configure Windows, VMware, Virtualization and Cisco on http://www.HowToNetworking.com


How to connect to CRM application running on SQL 2012 on Server 2008 Standard

$
0
0

I have a customer who has an SBS-2008 Server which is the AD, Exchange, Remote Access, etc. Then we have a second 2008 Standard Server, which is handling the Accounting application (Sage) and now the CRM program by Sage.

Because people access the systems remotely on the SBS 2008 server I have Port 443 in the router pointing to the SBS server. Now the Salesmen using the new CRM product would like to connect when out of the office but can't because I am not sure how to open up a second port 443 pointing to the Second Standard 2008 Server. We have 5 Static IP addresses, but are only using one currently.

I am currently on a Linksys router, getting ready to put in a WatchGuard router. I am not sure how to configure access to the new CRM Database on the second server. Any suggestions or direction would be appreciated.

thank you, DJ


DJ Grieb The PC Doctor

How can I architect my data layer to yield query result pages to the application as SQL Server prepares them?

$
0
0

I tried to make the question as explicit as possible.

Refer to Sql Server Management Studio's Results view.  Depending upon the structure of the execution plan, the Results pane may begin displaying results while the query is still executing.  Can someone point me in a direction for architecting a data layer (I am tech and framework agnostic for this task. Any solution will suffice) that will begin receiving pages of the set before SQL Server has completed the entire query?

The call from the data layer to SQL Server will obviously have to be asynchronous, but is there any additional ceremony that I need to be aware of when issuing OPTION (FAST x) to the query optimizer?

SQL SELECT Question with SUM()

$
0
0

Hi everyone.  I am working with a SQL Query that works well now.  I am pulling data from multiple collumns.  My problem is, I want to SUM the columns returned from a particular table, but I'm not sure how this is supposed to be done.

Something like:

Customers.ID, Customers.Name, Customers.Activity, Job.ID, Job.JobType, SUM(Billing.Amount) FROM Customers LEFT OUTER JOIN Job ON Job.CustomerID = Customers.ID LEFT OUTER JOIN Billing ON Billing.JobID = Job.ID WHERE Job.JobStatus = 'Active'  ORDER BY Name Desc

This works if I am just getting the amount of the Billing Columns (It creates multiple rows, which makes sense as there would be one from each billing).  However, I can't seem to get these to SUM.  Also, I want to do something like this:

Customers.ID, Customers.Name, Customers.Activity, Job.ID, Job.JobType, SUM(Billing.AmountWHERE Billing.BillingType = 'Invoice') FROM Customers LEFT OUTER JOIN Job ON Job.CustomerID = Customers.ID LEFT OUTER JOIN Billing ON Billing.JobID = Job.ID WHERE Job.JobStatus = 'Active'  ORDER BY Name Desc

But the bold bit obviously wouldn't be acceptable.  I'm just not sure how to handle multiple Where's like this...

Any help would be greatly appreciated.  :)

Viewing all 4164 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>