Showing posts with label helloi. Show all posts
Showing posts with label helloi. Show all posts

Wednesday, March 28, 2012

How do I access a mdf-file directly?

Hello!
I want to access a sql server file without having sql server installed on my laptop. How can I do this? Can you give me an example please because I'm new with it.
Thx a lot!
TomI don't think this can be done. The closes you can get is to do a minimial installation, use the Personal Desktop edition. I don't think there is any tool our COM object that will allow one to open the file and read throuigh it.

If you need to analyse some data or tables you could export the data to MS Access, Excel or flat files.|||You will need to install either msde (I think) or sql server then you can do a sp_attach_single_file_db to access the database.|||I dont think that you would be able to do it.
But as suggested previously, you can try minimal installation and then get the data out in the format that you want.

Thanks|||hii
i think there is a microsoft desktop engine which minimally installs the components required by SQL. Try that that. i dont have info on that at the moment . will try to get u|||hii
Install MSDE which comes in the office 2000 Cd and Use SQL DMO object and attach it to the instance of MSDE. Try , it should work

:confused:

Monday, March 19, 2012

how can you pre-sort in a UNION

Hello:
I would like to not use a temporary table but I cannot seem to find a
solution on how to return
a recordset as the union of two recordsets with the second recordset sorted.
SELECT 0 as intDOCTYPEunid,
'ANY TYPE' as vcDOCTYPEexplicit,
'ANY TYPE OF DOCUMENT' asvcDOCTYPEDescription
UNION
SELECT intDOCTYPEunid,
vcDOCTYPEexplicit,
vcDOCTYPEDescription
FROM DOCTYPE
RETURN
-- I want A"NY TYPE" to always be the first row and the other rows to be
sorted by vcDOCTYPEexplicit
-- I tried using a sorted view for the second SELECT statement but the union
unfortunately destroys the sort order: a priori, I dont see why
it does that as it would be a great workaround...
Thanks
TerrySupport
SELECT <column lists> FROM
(
SELECT 0 as intDOCTYPEunid,
'ANY TYPE' as vcDOCTYPEexplicit,
'ANY TYPE OF DOCUMENT' asvcDOCTYPEDescription
UNION ALL
SELECT intDOCTYPEunid,
vcDOCTYPEexplicit,
vcDOCTYPEDescription
FROM DOCTYPE
) AS Der ORDER BY --what you want
"Support" <RemoveThis_Support@.mail.oci.state.ga.us> wrote in message
news:umW3r%239pFHA.2956@.TK2MSFTNGP12.phx.gbl...
> Hello:
> I would like to not use a temporary table but I cannot seem to find a
> solution on how to return
> a recordset as the union of two recordsets with the second recordset
> sorted.
> SELECT 0 as intDOCTYPEunid,
> 'ANY TYPE' as vcDOCTYPEexplicit,
> 'ANY TYPE OF DOCUMENT' asvcDOCTYPEDescription
> UNION
> SELECT intDOCTYPEunid,
> vcDOCTYPEexplicit,
> vcDOCTYPEDescription
> FROM DOCTYPE
> RETURN
> -- I want A"NY TYPE" to always be the first row and the other rows to be
> sorted by vcDOCTYPEexplicit
> -- I tried using a sorted view for the second SELECT statement but the
> union unfortunately destroys the sort order: a priori, I dont see why
> it does that as it would be a great workaround...
> Thanks
> Terry
>|||Try this
Select * From(
SELECT 0 as intDOCTYPEunid,
'ANY TYPE' as vcDOCTYPEexplicit,
'ANY TYPE OF DOCUMENT' asvcDOCTYPEDescription
UNION
SELECT intDOCTYPEunid,
vcDOCTYPEexplicit,
vcDOCTYPEDescription
FROM DOCTYPE
) T order by case when vcDOCTYPEexplicit='Any type' then 1 else 0 end
Madhivanan|||Select * from
(
SELECT 0 as intDOCTYPEunid,
'ANY TYPE' as vcDOCTYPEexplicit,
'ANY TYPE OF DOCUMENT' asvcDOCTYPEDescription
1 as SortOrder
UNION
SELECT intDOCTYPEunid,
vcDOCTYPEexplicit,
vcDOCTYPEDescription
2 as SortOrder
FROM DOCTYPE
)
Order by SortOrder,vcDOCTYPEexplicit
--
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Support" wrote:

> Hello:
> I would like to not use a temporary table but I cannot seem to find a
> solution on how to return
> a recordset as the union of two recordsets with the second recordset sorte
d.
> SELECT 0 as intDOCTYPEunid,
> 'ANY TYPE' as vcDOCTYPEexplicit,
> 'ANY TYPE OF DOCUMENT' asvcDOCTYPEDescription
> UNION
> SELECT intDOCTYPEunid,
> vcDOCTYPEexplicit,
> vcDOCTYPEDescription
> FROM DOCTYPE
> RETURN
> -- I want A"NY TYPE" to always be the first row and the other rows to be
> sorted by vcDOCTYPEexplicit
> -- I tried using a sorted view for the second SELECT statement but the uni
on
> unfortunately destroys the sort order: a priori, I dont see why
> it does that as it would be a great workaround...
> Thanks
> Terry
>
>|||Support wrote:
> Hello:
> I would like to not use a temporary table but I cannot seem to find a
> solution on how to return
> a recordset as the union of two recordsets with the second recordset sorte
d.
> SELECT 0 as intDOCTYPEunid,
> 'ANY TYPE' as vcDOCTYPEexplicit,
> 'ANY TYPE OF DOCUMENT' asvcDOCTYPEDescription
> UNION
> SELECT intDOCTYPEunid,
> vcDOCTYPEexplicit,
> vcDOCTYPEDescription
> FROM DOCTYPE
> RETURN
> -- I want A"NY TYPE" to always be the first row and the other rows to be
> sorted by vcDOCTYPEexplicit
> -- I tried using a sorted view for the second SELECT statement but the uni
on
> unfortunately destroys the sort order: a priori, I dont see why
> it does that as it would be a great workaround...
Why it doesn't work the second way: A union says "return me a unique
set of rows", so after all rows are produced by the individual selects,
they're all sorted into an order (what order is determined by the
system) and eliminates the duplicates, then returns them. You might
then think "If I do a UNION ALL" (where it doesn't remove duplicates),
that'll work. And for some queries it may, but that is by no means
guaranteed, since a UNION ALL tells the system that it can return rows
from any of the selects as soon as those rows are available.
Best I can think of is to have the top select return a 0 in 1 column
(e.g. Called SortOrder) followed by any values you want/need for
remaining columns, and have the bottom select return 1 followed by the
columns on which sorting is done. Then you can order the whole union on
SortOrder, <other columns>
Damien|||Thanks to all: good help!
Take care
"Support" <RemoveThis_Support@.mail.oci.state.ga.us> wrote in message
news:umW3r%239pFHA.2956@.TK2MSFTNGP12.phx.gbl...
> Hello:
> I would like to not use a temporary table but I cannot seem to find a
> solution on how to return
> a recordset as the union of two recordsets with the second recordset
> sorted.
> SELECT 0 as intDOCTYPEunid,
> 'ANY TYPE' as vcDOCTYPEexplicit,
> 'ANY TYPE OF DOCUMENT' asvcDOCTYPEDescription
> UNION
> SELECT intDOCTYPEunid,
> vcDOCTYPEexplicit,
> vcDOCTYPEDescription
> FROM DOCTYPE
> RETURN
> -- I want A"NY TYPE" to always be the first row and the other rows to be
> sorted by vcDOCTYPEexplicit
> -- I tried using a sorted view for the second SELECT statement but the
> union unfortunately destroys the sort order: a priori, I dont see why
> it does that as it would be a great workaround...
> Thanks
> Terry
>

Wednesday, March 7, 2012

How can I verify that the sqlserver on my development is accessable from internet

Hello!
I'm trying to figure out if it's possible to reach the database on my
development machine from the outside (internet). To test this I'm trying to
connect to the database from the development machine by using my public IP
address. I also opned port 1433 in my firewall.
Is there any other ports I need to open? How can I verify that the sqlserver
on my development is accessable from internet?
Thanks!"Nutshell" <nospam@.nospam.com> wrote in message
news:%239FNk8bgHHA.596@.TK2MSFTNGP05.phx.gbl...

> I'm trying to figure out if it's possible to reach the database on my
> development machine from the outside (internet). To test this I'm trying
> to connect to the database from the development machine by using my public
> IP address. I also opned port 1433 in my firewall.
> Is there any other ports I need to open?
You'll want to give this a read (and some of the related links):
http://support.microsoft.com/kb/823938/en-us

> How can I verify that the sqlserver on my development is accessible from
> internet?
You should be able to use Query Analyzer or OSQL as a basic test
mechanism...
Steve|||Hello Steve,
I'll guess that the SQL Server need to use a static port?
1. From SQL Server Network Utility I'll see that port 1433 is default.
2. In the registry the settings looks like dynamic port allocation
3. The log displays:
2007-04-19 07:49:42.21 server SQL server listening on 192.168.0.6: 1433.
2007-04-19 07:49:42.34 server SQL server listening on 127.0.0.1: 1433.
2007-04-19 07:49:42.34 server SuperSocket Info: Bind failed on TCP port
1433.
2007-04-19 07:49:42.60 server SuperSocket Info: Bind failed on TCP port
1433.
I have tested to change the port to 1500, but I get the same bind error,
"Bind failed on TCP port 1500".
I have both SQL Server 9, and SQL Server Express on this machine. Is that
the problem?
Thanks!
"Steve Thompson" <stevethompson@.nomail.please> skrev i meddelandet
news:eOtYGIfgHHA.4916@.TK2MSFTNGP06.phx.gbl...
> "Nutshell" <nospam@.nospam.com> wrote in message
> news:%239FNk8bgHHA.596@.TK2MSFTNGP05.phx.gbl...
>
> You'll want to give this a read (and some of the related links):
> http://support.microsoft.com/kb/823938/en-us
>
> You should be able to use Query Analyzer or OSQL as a basic test
> mechanism...
> Steve
>