Showing posts with label unix. Show all posts
Showing posts with label unix. Show all posts

Friday, March 30, 2012

okay, Im frustrated....how do I

Greetings, all!

I've searched the MS SQL Server Books Online and this group.

I've been doing Oracle on UNIX for 12+ years, and now I have some SQL
Server databases.

I've discovered the INFORMATION_SCHEMA tables (just like the good ol'
dba_* views in
Oracle)

I've figured out how to use SQL2005 Management Studio.

What'd I'd like to know is - can SQL Server be used to write SQL like
Oracle can; e.g:

spool csyn.sql
set heading off
set pagesize 6000

select 'CREATE PUBLIC SYNONYM '||table_name||' FOR
SYSADM.'||TABLE_NAME||';'
from dba_tables where owner='SYSADM';

spool off

In SQL*Plus, the above will create a script to create public synonyms
for tables in a PeopleSoft database (tables in PeopleSoft multiply like
Tribbles in a storage bin of quadrotriticale...).

Yah, GUI's are fine...until you have thousands and thousands of tables
to deal with!

Thanks ever so mucha_dba_used_to_oracle wrote:

Quote:

Originally Posted by

Greetings, all!
>
>
I've searched the MS SQL Server Books Online and this group.
>
I've been doing Oracle on UNIX for 12+ years, and now I have some SQL
Server databases.
>
I've discovered the INFORMATION_SCHEMA tables (just like the good ol'
dba_* views in
Oracle)
>
I've figured out how to use SQL2005 Management Studio.
>
What'd I'd like to know is - can SQL Server be used to write SQL like
Oracle can; e.g:
>
spool csyn.sql
set heading off
set pagesize 6000
>
select 'CREATE PUBLIC SYNONYM '||table_name||' FOR
SYSADM.'||TABLE_NAME||';'
from dba_tables where owner='SYSADM';
>
spool off
>
In SQL*Plus, the above will create a script to create public synonyms
for tables in a PeopleSoft database (tables in PeopleSoft multiply like
Tribbles in a storage bin of quadrotriticale...).
>
Yah, GUI's are fine...until you have thousands and thousands of tables
to deal with!
>
Thanks ever so much


Try:

SELECT 'CREATE SYNONYM dbo.'
+QUOTENAME(table_name)+' FOR '
+QUOTENAME(table_schema)+'.'
+QUOTENAME(table_name)
FROM information_schema.tables
WHERE table_schema = 'SYSADM' ;

This example assumes you have a schema called SYSADM and that you want
the synonym to belong to the dbo schema. You can do without the
QUOTENAME functions if your table names are such that they don't need
quoting (essentially that means no spaces, punctuation or reserved
words.

Run the script in Text mode (CTRL+T or click the "Results to Text"
button on the toolbar). Then either cut-and-paste the result into the
query window or save it to a file (Right-click, Save As).

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/...US,SQL.90).aspx
--

Tuesday, March 20, 2012

Odd issue connecting to a named instance.

Hi everyone,

Please forgive me for the newbie question, I've done almost all of my DBA work on Oracle(on UNIX so I'm learning alot of AD stuff too) and am new to MS SQL Server.

I've got a SQL 2005 standard server that I'm trying to get to act as a publisher for a SQL 2005 Express instance, and I think I've narrowed down my problem to a connection issue.

(FYI, the Publisher works fine with another 2005 Standard server)

When I try to connect from the standard server to the express server using 'XYZ\SQLEXRESS' as my server name, it fails stating that it couldn't find the service, but I can connect just fine if I use 'XYZ' as the server name.

I think this is why I'm having trouble getting replication going as the replication wizard tells me that I have to connect via 'XYZ\SQLEXPRESS' in order to run the replication scripts.

Can anyone point me to the correct documentation to resolve this problem? Everything was easy-mode DBA work until we tried to add SQL Express to the mix, and I'm sort of running out of time on this one.

Thanks for any help!

The main thing to check is SQLExpress will default to local only connectivity mode. So if you are trying to access SQLExpress from a different machine this will not work unless you enable remote access. To do this run the SQL Server 2005 Surface Area Configuration tool and select your instance and enable remote connections (then restart SQLExpress instance).

If everything is local, then I would suspect that the SQL Browser service is disabled. This service is used to locate named instances. So enable this service and start it and everything should start working.

|||

Ahh, I'm sorry I didn't clairify.

I've got network connections on the SQL Express machine enabled, and is setup on port 1433. I'm attempting to connect from a remote machine via the management tool for testing purposes. If I try to connect using 'XYZ' as my server, it works, but if I try to connect using 'XYZ\SQLEXPRESS', it fails. I can connect as ether if I am doing it locally on the SQL Express machine.

Thanks again!

EDIT: Hahaha! You gave me the answer anyways. I enabled the SQL browser, and it worked. :-)

Thanks for beign a life-saver.

|||

Ahh cool!

Monday, February 20, 2012

ODBC Inserts are very slow

Hi,

I am new to the windows world. We use Informatica on UNIX for ETL process. We have a requirement to load approx. 200,000 rows to a MS SQL Server table . The table is not that big and it is a heap table (no indexes). Inserts are taking 69 rows/per minute. We are using DataDirect Closed 4.10 SQL Server ODBC driver.

SQL Profiler tells us that is is doing a row by row processing and using sp_execute procedure.

Is there a way we can speed up the ODBC process?

-Thanks in advance
srv

SQL Server Version:
Microsoft SQL Server 2000 - 8.00.818 (Intel X86) May 31 2003 16:08:15 Copyright (c) 1988-2003 Microsoft Corporation Standard Edition on Windows NT 5.0 (Build 2195: Service Pack 4)That would appear to be an older version of Informatica (pre-2003 installation). There was a problem that was fixed late in the year (2003-09 I think).

As a work-around, have Informatica generate a flat text file (tab delimited is my preference, columnar is often simplest, CSV is tolerable). FTP that file to your NT machine, then use DTS or BCP to load the file into SQL Server. You should have no trouble getting 10000 rows per minute from a mid-range workstation, and could get 1000000 rows per minute on a sufficiently beefy server.

-PatP|||If possible use DTS in SQL server which used BULK LOAD process for such load and for further information refer to the books online or http://www.sqldts.com website.
HTH|||We performed a test with Informatica 7.x and same odbc drivers and it 4 times faster. --Thanks

ODBC from unix client to MSSQL server?

Anyone support a config where you have an unix/linux (AIX here) ODBC
client connection to SQL Server database? I am looking for a simple,
supportable configuration that does not require me to learn perl or
instal a bunch of crap gnu shareware on enterprise class machines.
Please help!
You can try the JDBC driver for SQL Server 2000 - watch out
for line wrap on the link:
http://www.microsoft.com/downloads/d...displaylang=en
You can find more information on other alternatives at:
http://www.sommarskog.se/mssql/unix.html
-Sue
On Thu, 29 Jul 2004 12:34:38 -0700, "sumGirl"
<sumGirl@.discussions.microsoft.com> wrote:

>Anyone support a config where you have an unix/linux (AIX here) ODBC
>client connection to SQL Server database? I am looking for a simple,
>supportable configuration that does not require me to learn perl or
>instal a bunch of crap gnu shareware on enterprise class machines.
>Please help!
|||Have you checked out FreeTDS at www.freetds.org.
"sumGirl" <sumGirl@.discussions.microsoft.com> wrote in message
news:8F5C9D39-C780-4A29-B305-DA598CB760EC@.microsoft.com...
> Anyone support a config where you have an unix/linux (AIX here) ODBC
> client connection to SQL Server database? I am looking for a simple,
> supportable configuration that does not require me to learn perl or
> instal a bunch of crap gnu shareware on enterprise class machines.
> Please help!
>

ODBC from unix client to MSSQL server?

Anyone support a config where you have an unix/linux (AIX here) ODBC
client connection to SQL Server database? I am looking for a simple,
supportable configuration that does not require me to learn PERL or
instal a bunch of crap gnu shareware on enterprise class machines.
Please help!You can try the JDBC driver for SQL Server 2000 - watch out
for line wrap on the link:
AA54BFDC03A&displaylang=en" target="_blank">http://www.microsoft.com/downloads/...&displaylang=en
You can find more information on other alternatives at:
http://www.sommarskog.se/mssql/unix.html
-Sue
On Thu, 29 Jul 2004 12:34:38 -0700, "sumGirl"
<sumGirl@.discussions.microsoft.com> wrote:

>Anyone support a config where you have an unix/linux (AIX here) ODBC
>client connection to SQL Server database? I am looking for a simple,
>supportable configuration that does not require me to learn PERL or
>instal a bunch of crap gnu shareware on enterprise class machines.
>Please help!|||Have you checked out FreeTDS at www.freetds.org.
"sumGirl" <sumGirl@.discussions.microsoft.com> wrote in message
news:8F5C9D39-C780-4A29-B305-DA598CB760EC@.microsoft.com...
> Anyone support a config where you have an unix/linux (AIX here) ODBC
> client connection to SQL Server database? I am looking for a simple,
> supportable configuration that does not require me to learn PERL or
> instal a bunch of crap gnu shareware on enterprise class machines.
> Please help!
>