all groups > sql server programming > october 2007 >
You're in the

sql server programming

group:

List format of select result


Re: List format of select result Steve Dassin
10/8/2007 3:05:34 PM
sql server programming:
I'm curious, can you give a simple example of exactly what SELECT LIST...
gives as a result.

steve
www.beyondsql.blogspot.com

[quoted text, click to view]

Re: List format of select result Liz
10/8/2007 3:10:19 PM

[quoted text, click to view]


run it from where? SQL Management Studio? Query Analyzer? in either of
those cases, you can press Ctrl-D to display your results in a grid and
Ctrl-T to display results in text, this latter being apparently being what
you've been doing ... there are also icons in the UI to change this option
....



[quoted text, click to view]

Re: List format of select result Awlnoing
10/8/2007 5:15:19 PM
Looks like a job for XML...

[quoted text, click to view]

Re: List format of select result Liz
10/8/2007 5:49:37 PM

[quoted text, click to view]


There is a free GUI admin tool for SQL Express:
http://www.microsoft.com/downloads/details.aspx?familyid=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en

.... but I don't know anything about it; there are also quite a few free and
cheap ones to be had on the 'net if you can't write your own or do not have
the budget for something like the Redgate tools; for one, see
http://www.simego.com ... pretty good stuff ... but no data compare

but something is wrong here ... you should not be needing to do all of this
import/export to validate the operations ...

L


List format of select result webcliff NO[at]SPAM gmail.com
10/8/2007 7:34:44 PM
Hello,

As a MS SQL newbee, I may be asking stupid questions.

By default, when I run select * from atable, here is the format I get:

column1 column2
---------------------------
value11 value12
value21 value22

If the columns and the rows are too many, it is not easy to know a
value belongs to which column.

What I'd like to have is a list format looks like this:

column1:value11
column2:value12
column1:value21
column2:value22

The name of the columns shouldn't be embedded in the select statement
because it's changing.

Thanks for any help,

webcliff
Re: List format of select result David Portas
10/8/2007 8:39:35 PM
[quoted text, click to view]

This isn't really a SQL question because SQL Server doesn't control the way
data is displayed on the screen or on the page. Use your development
language, client application or reporting tool.

--
David Portas

Re: List format of select result webcliff NO[at]SPAM gmail.com
10/8/2007 8:50:40 PM
Hello everybody, thanks for help.

Here is what I really tring to do:
I need to export some tables and records, and import it back. To make
sure the export and import is successful, firstly I select everything
to txt files, then clear the db, then import, then select everything
to txt files again, then compare two sets of txt files to see if there
are any differences.

I am using SQL server 2005 express, I am not sure if I can get free
SQL Management Studio or Query Analyzer.
Write a utility from C# side (what I am using) might solve this
problem, just don't know I need to do it, I have some experience with
Empress DB, I can use "SELECT LIST from atable" to get what I want.

Thanks again.



[quoted text, click to view]

Re: List format of select result Joe Fawcett
10/8/2007 8:58:50 PM
Are you talking about when using the SQL Server Management Studio?
You can change to grid output, either click the icon above the query window
or use the shortcut Ctrl+D, then the headers stay fixed.

--

Joe Fawcett (MVP - XML)

http://joe.fawcett.name

[quoted text, click to view]

Re: List format of select result David Portas
10/8/2007 11:20:51 PM
[quoted text, click to view]

That's a painful way to compare two data sets. Why not write a query to
compare them? Or use a tool like:
http://www.red-gate.com/products/SQL_Data_Compare/index.htm

--
David Portas

Re: List format of select result webcliff NO[at]SPAM gmail.com
10/9/2007 4:16:33 AM
[quoted text, click to view]


Here you go:

7* select * from ROSPatient where oid="2200948185.1806.3368352283.56"
list;
oid: 2200948185.1806.3368352283.56
createTime: 1190914048
updateTime: 1190914288
name: bbb^bbb
id: bbb
otherId:
otherName:
mrl:
birthDate: 19901010
birthTime:
age: 016Y
sex: F
ethnicity:
admDiagDesc:
comments:
history:
discharge: 0
protection: 0

The exact syntax is actually like "select * from atable list"
Re: List format of select result webcliff NO[at]SPAM gmail.com
10/9/2007 4:56:45 AM
[quoted text, click to view]


well, let me provide more details, the system I am working on is a
patient images management system, patient informations could be
removed, and then imported back for reviewing.
When removed, the patient information (images) are saved to DICOM (a
medical standard format) files, these files are used when importing
back to the system.

During the DB->DICOM->DB transmission, some information (db columns)
are lost because it is generally not a good idea to dump all db
columns to a DICOM file, only a certain part of db columns are saved
to DICOM files.

My work is the import part, I basically need to make sure the imported
patient information is correct, since there are quite a few things
could be done to the imported data, I don't see any easy way to
validate the imported data (also considering versioning), we have been
talking about using auto test to do the validation.

The txt files comparison is used during the import developing, I don't
know if there are any other better ways to compare the original db
data and the imported db data, maybe I can try keep the original db,
import to a different db, then compare tables in two DBs?

It is certainly not something I am pround of, unfortunately I probably
have to stand for it for a while.
AddThis Social Bookmark Button