Showing posts with label sqlserver. Show all posts
Showing posts with label sqlserver. Show all posts

Wednesday, March 28, 2012

How to connect via ODBC

Hi,

I would like to connect in SqlServer 2005 via ODBC SQLServer, how are the steps?

1 - How can I connect ODBC?

1.1 - I need SqlServer 2005 name - ok

1.2 - Which option should I take in order to login? Windows NT authentication or Sql Server authentication?

Which one is the best option?

Cheers,

Alessandro

1.2 - Which option should I take in order to login? Windows NT authentication or Sql Server authentication?

That depends - Windows authentication is almost always better but if you cannot use it then SQL Server authentication is fine as long as you have it enabled on the server and you have created a login on the server. With Windows authentication you can easily use existing Windows domains, groups and users, you don't have to create everything on the server and use extra login names and passwords.

What type of application are you using to connect to SQL Server? ODBC should be your last choice, rather use OLE DB or the .NET data provider if you can.

|||

Hi,

- I picked windows authentication. I can not use OLE DB from my application.

I've created one windows user and created one login, but I still getting "Not associated with a trusted SQL Server connection". I changed Surface Area configuration and Configuration Manager as well. I heard that I nedd to enable mix mode option, how can I do this?

thanks

|||

You haven't told me anything about your application or why you can't use OLE DB, so I'm guessing - but it sounds like you cannot use Windows authentication. In SQL Server Management Studio, right click your server and select Properties. Select the Security page, and on that page select the SQL Server and Windows Authentication mode radio button.

Then add a SQL Server login, and use that login and password in your connection string.

Monday, March 26, 2012

How To Connect To Sql Server

Hi

Im trying to develop an information system using CRYSTAL REPORT XI.

Im really having a hard time connecting to a SQLSERVER 2000 database server on my network...

I've tried manipulating the datasource but to no avail... If anyone can help me by showing some example please do...

i would really appreciate your help...

Thanks...!!If you just want to connect to MSSQL from CRXI and add database tables for your report, use OLEDB provider for SQL Server. The connection process is self-explanatory.

Friday, March 23, 2012

how to connect sql server to oracle

ha
i am facing the problem that
i am unable to connect sql server to oracle
i have sqlserver in my system and oracle server is in remote
i want to access that database with using DTS
so that ,mmy memory will bw save
could any one please help for this
please yaar i am waitinf fro urs reply
Configure it as a linked server. To create linked server , open
EM->Security->Linked Server.
vinu
"dev" <dev@.discussions.microsoft.com> wrote in message
news:50B38365-9030-4810-9753-D58C5FAD591E@.microsoft.com...
> ha
> i am facing the problem that
> i am unable to connect sql server to oracle
> i have sqlserver in my system and oracle server is in remote
> i want to access that database with using DTS
> so that ,mmy memory will bw save
> could any one please help for this
>
> please yaar i am waitinf fro urs reply
>
|||hi
vinu
i did that
EM->Security->Linked Server.
but when ever i am trying to acess the table it gives a message that
ERROR 7399:OLEDB provider 'MSDAORA' reported an error
could u please clarify about this
"vinu" wrote:

> Configure it as a linked server. To create linked server , open
> EM->Security->Linked Server.
> vinu
>
> "dev" <dev@.discussions.microsoft.com> wrote in message
> news:50B38365-9030-4810-9753-D58C5FAD591E@.microsoft.com...
>
>
|||This might be helpful
http://support.microsoft.com/kb/280106
vinu
"dev" <dev@.discussions.microsoft.com> wrote in message
news:4A97A14E-04C8-4460-9688-2A4FAD4697FB@.microsoft.com...[vbcol=seagreen]
> hi
> vinu
> i did that
> EM->Security->Linked Server.
> but when ever i am trying to acess the table it gives a message that
> ERROR 7399:OLEDB provider 'MSDAORA' reported an error
> could u please clarify about this
>
> "vinu" wrote:
|||hi vinu
let me try this it will take some time it has some work with registry
fro that it s late
thanks fro giviing this suggestion
if nothing i will get back to you
thanks yaar
"vt" wrote:

> This might be helpful
> http://support.microsoft.com/kb/280106
>
> vinu
>
> "dev" <dev@.discussions.microsoft.com> wrote in message
> news:4A97A14E-04C8-4460-9688-2A4FAD4697FB@.microsoft.com...
>
>
|||Can you connect using the native Oracle tools? net Configuration Assistant
provides a means of testing the connection, and SQL+ will also do the same.
This is the first step and the most often missed step - to check that you
have a valid TNS entry and the firewall is correctly configured.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
sql

How to connect SQL Server to an Oracle database

I need to connect to an Oracle database (8i) running in a UNIX box, with SQL
Server running in AD.
If anyone has done it, kindly let me know since this is new territory for me.
Thanks,
Neil
Install the Oracle client on the SQL Server box.
Configure the client side (SQL Server box) tnsnames, Oracle
alias as needed for your Oracle environment.
Configure a linked server, following the books online topic:
OLE DB Provider for Oracle
as well as the following article:
HOW TO: Set Up and Troubleshoot a Linked Server to Oracle in
SQL Server
http://support.microsoft.com/?id=280106
-Sue
On Fri, 13 Jan 2006 09:31:39 -0800, N.Ordiers
<NOrdiers@.discussions.microsoft.com> wrote:

>I need to connect to an Oracle database (8i) running in a UNIX box, with SQL
>Server running in AD.
>If anyone has done it, kindly let me know since this is new territory for me.
>Thanks,
>Neil

How to connect SQL Server to an Oracle database

I need to connect to an Oracle database (8i) running in a UNIX box, with SQL
Server running in AD.
If anyone has done it, kindly let me know since this is new territory for me
.
Thanks,
NeilInstall the Oracle client on the SQL Server box.
Configure the client side (SQL Server box) tnsnames, Oracle
alias as needed for your Oracle environment.
Configure a linked server, following the books online topic:
OLE DB Provider for Oracle
as well as the following article:
HOW TO: Set Up and Troubleshoot a Linked Server to Oracle in
SQL Server
http://support.microsoft.com/?id=280106
-Sue
On Fri, 13 Jan 2006 09:31:39 -0800, N.Ordiers
<NOrdiers@.discussions.microsoft.com> wrote:

>I need to connect to an Oracle database (8i) running in a UNIX box, with SQ
L
>Server running in AD.
>If anyone has done it, kindly let me know since this is new territory for m
e.
>Thanks,
>Neil

How to Connect remote Access database to SQL server

Hai,
I want to Convert remote Ms access data to sqlserver data.
Here i am using FTP Task in DTS for downloading Ms Access database to local machine.
After that, I convert it to sql data.
But, most of time, With download the mdb file, the message 'Opreation sucessfully' display.
Please give solution for this.
With regards,
dharmaprakash.
**********************************************************************
Sent via Fuzzy Software @. http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...Please do not post separately in different groups.
Whats the matter if its performed successfully.
Jens Süßmeyer.

Wednesday, March 21, 2012

how to connect from client to SQLserver

hi group!
i have problem with connection from client to sqlserver.
and what must i do?
thanks alot.:(Part from VB: open connection and call sp for update with parameters...

May be it is a little complicated for novice...

Dim MConnection As ADODB.Connection
Dim MCommand As ADODB.Command
Dim MRecordset As ADODB.Recordset
Dim MParameter As ADODB.Parameter

Set MConnection = CreateObject("ADODB.Connection")
Set MCommand = CreateObject("ADODB.Command")

LineConnect = "Provider=SQLOLEDB;Data Source=YourServer;UID=sa;PWD=sa"
MConnection.ConnectionString = LineConnect
MConnection.Open
With MCommand
.CommandText = "estore..UpdateLogin"
.ActiveConnection = MConnection
.CommandType = adCmdStoredProc
.Parameters.Append MCommand.CreateParameter("RetVal", adInteger, adParamReturnValue)
.Parameters.Append MCommand.CreateParameter("Id", adInteger, adParamInput, , 0)
.Parameters.Append MCommand.CreateParameter("username", adLongVarChar, adParamInput, 20, UName)
.Parameters.Append MCommand.CreateParameter("loginname", adLongVarChar, adParamInput, 128, LName)
.Parameters.Append MCommand.CreateParameter("password", adLongVarChar, adParamInput, 128, LPass)
.Parameters.Append MCommand.CreateParameter("usertypeid", adInteger, adParamInput, , UType)
End With

Set MRecordset = MCommand.Execute
If MRecordset.EOF Or MRecordset.BOF Then
.....................

another one:
Dim MConnection As ADODB.Connection
Dim MCommand As ADODB.Command
Dim MRecordset As ADODB.Recordset

Set MConnection = CreateObject("ADODB.Connection")
Set MCommand = CreateObject("ADODB.Command")

LineConnect = "Provider=SQLOLEDB;Data Source=ServerName;UID=sa;PWD="
MConnection.ConnectionString = LineConnect
MConnection.Open
With MCommand
.CommandText = "select ... or call SP"
.ActiveConnection = MConnection
.CommandType = adCmdText
End With

Set MRecordset = MCommand.Execute
If MRecordset.EOF Or MRecordset.BOF Then
.....................

how to connect domain SQLSERVER2005 to WORKGROUP SQLSERVER2005

hi

COMPUTER-1

IP ::::: 129.100.100.5

COMPUTER NAME IS ::::: HASH

MEMBER OF DOMAIN

in this computer sqlserver express edition is installed, i want to remove this express becoz in configuration manager it show two SQLSERVER'S are running. when i browse from COMPUTER - 2 for network servers it show server name as HASH/SQLEXPRESS, but not the main SQLSERVER.

COMPUTER -2

IP::::129.100.100.142

COMPUTER NAME::: FEROZ

MEMBER OF WORKGROUP

can anyone help me how to connect these two computers and remove this express edition

iam new to sqlserver configuration

thanks in advance

waiting for eager reply

To remove Express Edition, go to Control Panel/Add & Remove Programs/SQL Server 2005 - Change, and it will show you what is currently installed, and you will be able to chose to remove your Express instance.

As for how to 'connect these two computers', do you mean for database mirroring? It isn't clear from your post, and this is a database mirroring forum.

Monday, March 19, 2012

How to Configure SQLServer with VSS6.0

I would like to configure Sql Server 2000 with Visual Source Safe 6.0
can any one guide me how to go about ...
atleast URLs that discuss on this work
thanks
SatishHi Satish,
Dint get ur Query Exactly. Looking for something Like this?
http://www.mssqlsourcesafe.com/mssqlXpress_Download.shtm
Best Regards
Thirumal
>--Original Message--
>I would like to configure Sql Server 2000 with Visual
Source Safe 6.0
>can any one guide me how to go about ...
>atleast URLs that discuss on this work
>thanks
>Satish
>
>.
>|||Satish,
There is no direct integration that I know of.
Save database objects such as stored procedures and triggers from Query Analyser or Enterprise Manager or a
Database project to file
Check them in and out from sourcesafe as files.
There have been a few discussions. You might try reading the archives:
http://www.google.com/advanced_group_search?hl=en
with sourcesafe as the subject, searching in microsoft.public.sqlserver.server
Regards
AJ
p.s. You can do mean/clever things like loading / overwriting SQL objects from sourcesafe using .bat files as
a means of enforcing that
developers use sourcesafe - as unlike a filesystem based project, the "sourcecode" is in the database and is
readwrite beyond sourcesafe's control, so it takes a certain discipline to always check the file out before
you modify the object in SQL.
"Satish" <kvensatish@.hotmail.com> wrote in message news:eguWRNrQDHA.2636@.TK2MSFTNGP10.phx.gbl...
> I would like to configure Sql Server 2000 with Visual Source Safe 6.0
> can any one guide me how to go about ...
> atleast URLs that discuss on this work
> thanks
> Satish
>

How to configure SQL server to use multiple processor

hi,
We have a system with two processors. What settings should we do in sql
server 2000 standard edition to use both the processors. Can anyone suggest?
Thanks
PremHello,
By itself SQL Server will use both processors. There is no change required.
Thanks
Hari
"Prem" <Prem_a20@.hotmail.com> wrote in message
news:uoDh1q8SHHA.4956@.TK2MSFTNGP04.phx.gbl...
> hi,
> We have a system with two processors. What settings should we do in sql
> server 2000 standard edition to use both the processors. Can anyone
> suggest?
> Thanks
> Prem
>
>|||underprocessable

Friday, March 9, 2012

How to Concatenate Strings That Have Trailing Spaces?

I am trying to export data from a SQLServer database into a text file
using a stored procedure. I want to be able to read it and debug it
easily; therefore, I want all the columns to indent nicely. This means
I need to append trailing spaces to a text string (such as "Test1 ")
or append leading space in front of a text string that contains a
number (such as " 12.00"). Now, the stored procedure works fine when
I run it in Query Analyzer. But it doesn't work correctly when I run
it using ISQL - All the columns are not indented. I am wondering why
it doesn't work in ISQL.

This is what I want, and this is also what I get when I run the stored
procedure using Query Analyzer:

Test1 , 2,Test1.txt , 1.00, 1.00
Test22 , 2,Test22.txt , ,
Test333 , 2,Test333.txt , 30.00, 30.00

This is what I get if I run the stored procedure using ISQL
(isql -S myserver -E -w 556 -h-1 -n -d mydb -Q "exec MyTest"):

Test1, 2,Test1.txt, 1.00, 1.00
Test22, 2,Test22.txt, ,
Test333, 2,Test333.txt, 30.00, 30.00

You can see that the result from ISQL has the following differences:
1. It puts a space in front of each row.
2. It appends enough spaces at the end of each line to make
the line length to be exactly 61 characters.
3. It gets rid of the trailing space from each column.
4. It leaves only one blank space if the column has nothing
but a serie of spaces.

The following is the stored procedure that I am testing:

create procedure MyTest
as

set nocount on

create table #Test
(
Field1 varchar(10) null,
Field2 varchar( 5) null,
Field3 varchar(20) null,
Field4 varchar(10) null,
Field5 varchar(10) null
)
insert into #Test values
( "Test1 ", " 2","Test1.txt ", " 1.00", " 1.00" )
insert into #Test values
( "Test22 ", " 2","Test22.txt ", " ", " " )
insert into #Test values
( "Test333 ", " 2","Test333.txt ", " 30.00", " 30.00" )

select Field1 + "," +
Field2 + "," +
Field3 + "," +
Field4 + "," +
Field5
from #Test

drop table #Test
go

Strangely, the differences #3 and #4 only show up when I use the
SELECT statement on a table. They don't show up when I use SELECT
statements to show constant text strings or string variables, like
this:

set nocount on
select "Test1 " + "," +
" 2" + "," +
"Test1.txt " + "," +
" 1.00" + "," +
" 1.00"
select "Test22 " + "," +
" 2" + "," +
"Test22.txt " + "," +
" " + "," +
" "
select "Test333 " + "," +
" 2" + "," +
"Test333.txt " + "," +
" 30.00" + "," +
" 30.00"

The result is like the following if I use constant text strings or
string variables:

Test1 , 2,Test1.txt , 1.00, 1.00

Test22 , 2,Test22.txt , ,

Test333 , 2,Test333.txt , 30.00, 30.00

I need to run it from ISQL because that is how I run _all_ my other
stored procedures. I don't want to do anything differently just
because I need to run this stored procedure.

Thanks in advance for any suggestion.

Jay Chan"Jay Chan" <jaykchan@.hotmail.com> wrote in message
news:c7e5acb2.0308120646.2c8593ec@.posting.google.c om...
> I am trying to export data from a SQLServer database into a text file
> using a stored procedure. I want to be able to read it and debug it
> easily; therefore, I want all the columns to indent nicely. This means
> I need to append trailing spaces to a text string (such as "Test1 ")
> or append leading space in front of a text string that contains a
> number (such as " 12.00"). Now, the stored procedure works fine when
> I run it in Query Analyzer. But it doesn't work correctly when I run
> it using ISQL - All the columns are not indented. I am wondering why
> it doesn't work in ISQL.

Check out the 'SET ANSI_PADDING' setting in BOL.

Ian.|||Jay Chan (jaykchan@.hotmail.com) writes:
> I am trying to export data from a SQLServer database into a text file
> using a stored procedure. I want to be able to read it and debug it
> easily; therefore, I want all the columns to indent nicely. This means
> I need to append trailing spaces to a text string (such as "Test1 ")
> or append leading space in front of a text string that contains a
> number (such as " 12.00"). Now, the stored procedure works fine when
> I run it in Query Analyzer. But it doesn't work correctly when I run
> it using ISQL - All the columns are not indented. I am wondering why
> it doesn't work in ISQL.

This is because with ISQL you get a different setting for ANSI_PADDING.
This setting is OFF by default with ISQL, but ON by default with Query
Analyzer. The effect of this setting is that if it is OFF, SQL Server
trims trailing spaces from varchar data when you insert it.

Use SET ANSI_PADDING ON in ISQL to get ISQL to behave like QA.

The setting is actually saved with the table column, so if you create
the table in QA, it should work in ISQL even with the setting off. (But
I have not tested this.)

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||> Check out the 'SET ANSI_PADDING' setting in BOL.

Thanks! This switch fixes the problem very nicely. Now, all the
columns indent correctly.

Jay Chan|||> This is because with ISQL you get a different setting for ANSI_PADDING.
> This setting is OFF by default with ISQL, but ON by default with Query
> Analyzer. The effect of this setting is that if it is OFF, SQL Server
> trims trailing spaces from varchar data when you insert it.
> Use SET ANSI_PADDING ON in ISQL to get ISQL to behave like QA.

Yes, you are right. I add the switch in my stored procedure right
before it starts creating temporary tables, and now it can indent the
column of info quite nicely. Thanks.

> The setting is actually saved with the table column, so if you create
> the table in QA, it should work in ISQL even with the setting off. (But
> I have not tested this.)

I believe this is correct according to the Help info on that switch. I
also create tables in Query Analyzer; this explains why I haven't come
across this problem until now.

Jay Chan

Wednesday, March 7, 2012

How to compare two versions of sqlserver?

HI,
I need to do an installer utility in which I have to install sql tables. In
there, I would need to check the version of sql server and add some
constraints if the sql server version is more than 8 and do alternate action
if its not.
Is there any function like version_compare()?
Thanks & Regards,
Celia
msnews wrote:
> HI,
> I need to do an installer utility in which I have to install sql tables. In
> there, I would need to check the version of sql server and add some
> constraints if the sql server version is more than 8 and do alternate action
> if its not.
> Is there any function like version_compare()?
> Thanks & Regards,
> Celia
>
>
There isn't a "out of the box" version compare function as such. I think
you'll have to use @.@.Version or SERVERPROPERTY and then use the result
you get from here to do your evaluation.
You can look up both options in Books On Line for further info and syntax.
Regards
Steen

How to compare two versions of sqlserver?

HI,
I need to do an installer utility in which I have to install sql tables. In
there, I would need to check the version of sql server and add some
constraints if the sql server version is more than 8 and do alternate action
if its not.
Is there any function like version_compare()?
Thanks & Regards,
Celiamsnews wrote:
> HI,
> I need to do an installer utility in which I have to install sql tables. I
n
> there, I would need to check the version of sql server and add some
> constraints if the sql server version is more than 8 and do alternate acti
on
> if its not.
> Is there any function like version_compare()?
> Thanks & Regards,
> Celia
>
>
There isn't a "out of the box" version compare function as such. I think
you'll have to use @.@.Version or SERVERPROPERTY and then use the result
you get from here to do your evaluation.
You can look up both options in Books On Line for further info and syntax.
Regards
Steen

How to compare two versions of sqlserver?

HI,
I need to do an installer utility in which I have to install sql tables. In
there, I would need to check the version of sql server and add some
constraints if the sql server version is more than 8 and do alternate action
if its not.
Is there any function like version_compare()?
Thanks & Regards,
Celiamsnews wrote:
> HI,
> I need to do an installer utility in which I have to install sql tables. In
> there, I would need to check the version of sql server and add some
> constraints if the sql server version is more than 8 and do alternate action
> if its not.
> Is there any function like version_compare()?
> Thanks & Regards,
> Celia
>
>
There isn't a "out of the box" version compare function as such. I think
you'll have to use @.@.Version or SERVERPROPERTY and then use the result
you get from here to do your evaluation.
You can look up both options in Books On Line for further info and syntax.
Regards
Steen

How to compare table from SQLSERVER 2005 with oracle

Hi,

i am trying to compare the table which is existing in SQL server2005 with the same in oracle 10g. is there any short cut procedure for it..?

Sreenivas

What do you want to compare the schema of the data ?

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||i want to compare the table structure including the datatypes of some xxx table in sql server with oracle table which is having the same name and structure..these two are located in different databases and different locations with different schema names..|||

I have a script for SQL Server which does the things on two different SQL Server databases. For Oracle you would have to do a comparison betwen the datatype which can differ although they are in common the same. Just write me a mail if you want to have this script.

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||

Jen,

Could u mail me the script for SQL server comparison..i dont have any script for oracle ...

I am trying to reach you at your mail id. but surprisely it bounce back to me..

Sunday, February 19, 2012

How to clear table?

Is there a way to clear all the records in a table in Microsoft SQLServer Management Studio instead of selecting all the rows and delete?

Try the link below and Truncate the table. Hope this helps.

http://msdn2.microsoft.com/en-us/library/ms177570.aspx

|||Thanks for the response, but I'm not looking for a code clear records.I am in Microsof SQL Management Studio. How do I clear the table withinthis tool?|||

Assuming no constraint defined on the table try the link below for a walkthrough. Hope this helps.

http://msdn2.microsoft.com/en-us/library/ms175491.aspx

|||That instruction only show how to delete a column. Are you suggestingthat deleting the column and then recreate that same column?|||

Sorry wrong link.

http://msdn2.microsoft.com/en-us/library/ms190616.aspx

|||That link shows how to delete the whole tabe. I don't want to deletethe whole table. All I want is to clear all the records in the table. Idon't want to recreate the whole table again.|||Truncate is the clean way to do it or you have to do it by column because a database table is columns with your data in rows so if you don't want to truncate you have to do it by column.|||The reason I asked about clearing the table records is because inphpMyAdmin with MySQL, it is very simple to clear the whole records ina table. I would be very surprise if Microsoft does not have thisfeature in their MS SQL Management Studio tool.|||

MySQL is generally free so you can do crude things but SQL Server cost a lot of money companies will not like data delete operations that cannot be traced. So the links below explain Truncate and Delete very clearly and some solutions using temp table. Hope this helps.

http://codebetter.com/blogs/raymond.lewallen/archive/2005/05/09/62960.aspx

http://www.sql-server-performance.com/q&a118.asp

|||Thanks! I will give those two links some reading.