Showing posts with label newbie. Show all posts
Showing posts with label newbie. Show all posts

Thursday, 22 March 2012

Connect to external DataBase Via SQLExpress?

Hi again... I guess this is yet another newbie question (Sorry if its been asked before!)

If I have an IP address for an external SQL DB with valid User & Pass... Can I connect to it using SQLExpress on my machine?

If so can anyone point me towards how to do it, or run through it below (In easy steps as I'm dumb )

Hi,

Yes, In the Server Name write your IP Address and Select Authenticaion Mode as SQL , supply your given credential and thats it!!! Once it let you in , right click on that IP Address in left corner and right click on it and select Register to Register the server.

Hemantgiri S. Goswami

|||

You can use Sql Server Management Studio (SSMS) to connect to other servers also. In Object Explorer window of SSMS, you have a Connect Combo in Top Left corner of Object Explorer window.

Steps are as follows

(a) Press on Connect

(b) Select Database Engine - You will get a "Connect To Server " window

(c) In this window Give IP Address in Server Name Text Box

(d) giver login name and passoward

(e) Press Connect Button

Madhu

|||Hi ... Many thanks for taking the time to reply, but I am getting this error message? Do I have to change any other settings?

TITLE: Connect to Server

Cannot connect to XX.XX.XX.XX

ADDITIONAL INFORMATION:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=53&LinkId=20476|||

Can you get the DBA to run SQL Server Surfice Area Configuration tool to chech that Name Pipes is allowed.

Also, one thing worth check, have you confirmed the port on the IP address.
Finally please remember to check the firewall settings on the server as this could also be causing you problems.

hth

Barry Andrew

|||Thank you very much! All sorted and connected :o)... Thankssqlsql

Tuesday, 20 March 2012

connect to database without server (was "Stupid Newbie Question - sorry in advan

Hi peoples...

I am a total newbie when it comes to SQL databases.

I currently work for a company developing software. We use a VB Development environment and connect to Dbase III database files using DAO... ewwwww...

We are looking to upgrade our development environment to VB.net and our database to either MSSQL or mySQL...

My question is - most of our users are on standalone machines. Our software is NOT internet based, nor do we want it that way at the moment.

Is there a way to connect to a MSSQL database (ie the .mdf file) without having a server running? Or are we better advised to stick to an MS Access database if this is the case...

Basically the reasoning behind upgrading is better speed and record locking. Any advice would be greatly appreciated.

I am sorry to sound so dumb...

Cheers,

KevMicrosoft offers MSDE (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmsde/html/msdeforvs.asp), the Microsoft Data Engine, which sounds like exactly what you need.

MSDE is a "workstation sized" version of Microsoft SQL Server. It offers a version of the database engine that is limited to 2 Gb per database, and is configured to run on a workstation (so it is missing a few of the really "high end" database features), that is 100% upward compatible with Microsoft SQL Server. It allows the developer to create databases that work on the desktop, can be scaled up to a few users (about 5) without any additional cost to either the developer or the user, and allow easy migration to SQL Server for larger groups of users.

While MSDE may not have the high end features such as clustering, replication management, etc., it IS a full blooded version of SQL Server. From the code perspective, it is almost impossible to tell MSDE from any other version of SQL Server. As your users needs grow, MSDE allows a quick and simple upgrade path to full-blown SQL Server. In almost every case I've seen, MSDE offers the best of both worlds... It is cheap and easy to start with, and can grow to support really large projects when necessary.

-PatP|||Thanks for that... so with MSDE, we would get 1 datafile containing all our tables that wouldn't need any software on the users machine?

Out of interest, what would the file extension be?|||You will need to install MSDE on your machine (and install it with your software), and you get at least two files, an MDF with the actual data and an LDF with the log.

The MSDE software is available to Visual Studio Professional (and above) developers, and a license to distribute it as part of an application that you develop is included with Visual Studio. Think of MSDE as part of the Visual Studio runtime environment.

Check out the link to the article from my previous posting. I think that article gives the "30,000 foot view" of MSDE and the distribution model. The whole process really isn't very complex, although you need to think on a bit broader scale than you did with dBase files. Once you make the jump, you'll never want to go back!

-PatP|||I have just tried installing MSDE - when I double click the setup file, it says it can't install because I don't have a "strongpassword" on SAPWD... I go to the knowledgebase article they reference for help on this and do what is says, it says to enter oSQL -U sa at the command prompt and it says oSQL isn't recognised as internal or external command etc etc...

I hate Microsoft.. I truly do|||Check here (http://support.microsoft.com/default.aspx?scid=kb;en-us;814463) for help with strong sa passwords from within code. As a general rule of thumb, just use a license plate or pick a sentence that you'll remember and take the first or last letter from each word to make a strong password.

-PatP|||Hi again Pat...

Ok, I am running windows xp professional... I have downloaded the MSDE file and doubleclicked setup... when I do, it comes up with an error... that link you gave me was about setting with password once it has been installed... from what I could see anyway..|||Hi,
What is the error message? And one more information, at default when u install .NET there is a option to install MSDB (stand alone database). Have u installed .NET?|||No, I have not installed .net.

I am still running VB6 as my development environment... I want to test the options available to me before I make my final decision.sqlsql

Thursday, 8 March 2012

Confusion with SQL Server database data types

I trust you'll bear with an SQL Server newbie with what may seem a rather inane request. I am designing a web app in Web Designer 2005 Express with SQL Server Express. Unfortunately, I'm finding a little confusing with some of the data types when designing tables. I have tried to find information on the various Microsoft sites (general site, MSDN, here) and while I found one document that had a table comparing data types in different implementations of SQL, it wasn't at all helpful. Most of my confusion is with the various string and char types; the numeric types seem pretty straight forward for the most part. However, it might be helpful to know the difference between money and smallmoney/datetime and smalldatetime, particularly space/size information and formatting options (unless the latter is up to the interface). It would also be helpful to know which string/char types correspond to any counterparts they might have in, for instance, Access (with which I am already quite exprienced). Or any particular quirks or idiosyncracies they might have. I don't expect anyone to write a full tutorial, but if someone could point me in the direction of a good online doc, it would be most appreciated. You might well ask, why not use Access databases? I would answer...I like to learn new stuff!

Thanks much.

Hi Eyetech... I agree, there seem to be lots of data types to chose from. Sorry, I cant do a case study on them all for you as I too am a relative newbie... I can share one experience though... I found a key difference between the nchar and vchar types. It seems the nchar forces the lenth of the data stored to be whatever length the field is declared as - padding with spaces when needed. I found all those padding spaces to be a real pain in my code... I've since moved away from nchar in favor of vchar. I suppose there may be some performance issues there, but so far the code's a lot more friendly. -- Curt

|||

curtisdehaven:

I found a key difference between the nchar and vchar types. It seems the nchar forces the lenth of the data stored to be whatever length the field is declared as - padding with spaces when needed. I found all those padding spaces to be a real pain in my code... I've since moved away from nchar in favor of vchar.

Thanks Curtis. Since my first post, I did some Googleing and found some very helpful information on a third-party website. It includes a table with the actual numeric ranges for numeric types (eg: int: integer data from -2^31 through 2^31-1 stored in 4 bytes). It also explains something that may be the cause of your woes in using nchar type. nchar is actually for storing unicode char data which uses 2 bytes instead of 1 for each character. char supports the 1-byte ASCII characters padded to fixed lengths while varchar is the variable length type. It is recommended that if you don't actually have to store unicode, avoid using the 'n' types and stick to char/varchar. It will certainly take up less space in your database in the long run since nchar and nvarchar will always take up double the space of their char/varchar counterparts.

Being new here, I'm not sure if it is appropriate to post links to outside sources. If someone can confirm that it is ok, I'll gladly add the link for others to refer to.

|||

Hi eyetech,

Yes, you can post links to outside resource. Thank you for sharing your knowlege with all the people here.

|||

The .NET Char is the nineth integer and Unicode by default so when you are using database Char/Varchar you are using bytes until 255, the reason Membership data types are Nvarchar instead of Varchars. The SQL Server team have prepared a comprehensive chart of the three type your application uses SQL Server, ADO.NET and FCL(framework class library). Hope this helps

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

SQL Server data type

CLR data type (SQL Server)

CLR data type (.NET Framework)

varbinary

SqlBytes, SqlBinary

Byte[]

binary

SqlBytes, SqlBinary

Byte[]

varbinary(1), binary(1)

SqlBytes, SqlBinary

byte, Byte[]

image

None

None

varchar

None

None

char

None

None

nvarchar(1), nchar(1)

SqlChars, SqlString

Char, String, Char[]

nvarchar

SqlChars, SqlString

SQLChars is a better match for data transfer and access, andSQLString is a better match for performing String operations.

String, Char[]

nchar

SqlChars, SqlString

String, Char[]

text

None

None

ntext

None

None

uniqueidentifier

SqlGuid

Guid

rowversion

None

Byte[]

bit

SqlBoolean

Boolean

tinyint

SqlByte

Byte

smallint

SqlInt16

Int16

int

SqlInt32

Int32

bigint

SqlInt64

Int64

smallmoney

SqlMoney

Decimal

money

SqlMoney

Decimal

numeric

SqlDecimal

Decimal

decimal

SqlDecimal

Decimal

real

SqlSingle

Single

float

SqlDouble

Double

smalldatetime

SqlDateTime

DateTime

datetime

SqlDateTime

DateTime

sql_variant

None

Object

User-defined type(UDT)

None

Same class that is bound to the user-defined type in the same assembly or a dependent assembly.

table

None

None

cursor

None

None

timestamp

None

None

xml

SqlXml

None