Showing posts with label creating. Show all posts
Showing posts with label creating. Show all posts

Monday, March 12, 2012

How to add new user whit pass for new database

Hy,
I have question reagrding to SQL Server Authentication, I use SQL express and Microsoft SQL Server Management Studio Express. For creating and editing databases, I login whit Windows Authentication and it works fine, but as I need this new empty database for ASP script on my localhost ISS, I dont know what to enter for Username and Password as SQL Server Authentication.
Ex. here is this connection string where I need to enter U/P but what to enter if I use Windows Authentication?

strCon = "Provider=SQLOLEDB;Connection Timeout=90;Server=AMD\SQLEXPRESS;User ID=?;Password=?;Database=test_database;"

Connectionstrings can be found on www.connectionstrings.com , for Windows Authentication you would have to do something like this:

"Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;"

More details on this can be found on the site mentioned above.

HTH, Jens Suessmeyer.


http://www.sqlserver2005.de

|||

Have a look at this post from SQL Server Central on the Security and login functions for SQL Server 2005.

|||

Hy again,
thanx, I was able to create new SQL login whit pass, but now when I try to login whit that U/P I get this error:

Login failed for user 'test'. The user is not associated whit a trusted sql server connection.
Microsoft SQL server, Error: 18452

Then I search for microsoft for this error and try this http://support.microsoft.com/kb/269587/en-us but I still get the same error.

|||

hi,

in order to accept the changes, SQL Server service must be restart after you modify this security setting...

do you still have torubles?

regards

|||I have restarted ISS before, but I tryied to restart my computer and it works now finaly. Thanx to all!

Friday, March 9, 2012

How to add data in sql mobile database from sql server 2005 management studio

Hi,

After creating mobile database into sql server 2005 management studio, how to insert the records from sql server 2005 management studio into and mobile database from excel file?

Thank you

Prashant

There is no automatic tool (or out-of-box usable tool) which you can use to import data into SQL Mobile from excel or .csv file. You need to write a small app that reads the data/rwo from excel file and inserts into SQL Mobile database.

Thanks,

Laxmi Narsimha Rao ORUGANTI, MSFT, SQL Mobile, Microsoft Corporation

Wednesday, March 7, 2012

How to add an "if then else" condition within an expression?

Greetings:

I am creating a complex expression in a Send Mail Task for the MessageSource. The expression contains the values of many package variables. I want to conditionally include some variables in the expression depending on what value they contain.

Is it possible to create conditional logic (if then else) within an expression? I've got to conditionally include 8 different variables.

Thanks,

BCB

Using the expression editor, you can look at the Operators. One of them is the "conditional."

This is what you want. (? Smile

your test ? if true : else false|||

Thanks, Phil.

This is part of the code I came up with to conditionally include "lines" in the body of my email message. The 2nd and 4th lines will appear only if the value of a variable is not empty. (Those are the lines that begin with Trim.) The key thing I discovered is that you need to enclose the conditional logic in parens in order for the overall expression to evaluate properly.

"The number of ESHL rows inserted was " + (DT_STR, 10, 1252) @.[User::ESHL_RowsInserted] + "." + "\n" +
(Trim(@.[User::ESHL_Error_LongMessage]) == "" ? "" : "\n" + "ESHL Message: " + @.[User::ESHL_Error_LongMessage] + "\n\n") +
"The number of Gulf States rows inserted was " + (DT_STR, 10, 1252) @.[User::GulfStates_RowsInserted] + "." + "\n" +
(Trim(@.[User::GulfStates_Error_LongMessage]) == "" ? "" : "\n" + "Gulf States Message: " + @.[User::GulfStates_Error_LongMessage] + "\n\n")

How to add a TCP endpoint in SQl Server 2005 Beta 2

Hi All,

I would like to know the syntax of creating an endpoint in SQL Server 2005 Beta 2 version.

The syntax which i am using is as follows:

create endpoint yuk1
state = started
as TCP
(
LISTENER_PORT = 4022
)
FOR SERVICE_BROKER (AUTHENTICATION = CERTIFICATE trpyuk1)

And i am getting the following error :

Incorrect syntax near 'CERTIFICATE'.

Regards
Deepak

You are using beta 3 syntax. Is there any reason why you are trying to use beta 2?|||Hi,

Ok, thanks for the update. SO is this syntax ok for the June Community Version?

Regards
Deepak|||Yes.

-mike

Sunday, February 19, 2012

How to accomplish creating a simple calculated column in a table

Is there a way to create a calculated column in a table like this, or is
there a better way to accomplish this task? I've tried, but SQL keeps
adjusting my precedence and it goofs up the formula:
Let's say the column name is "NetPrice". I want to deduct the discounted
amount from the total to arrive at the net price. Discount is a decimal
value, ie: 25% = .25.
[TotalPrice] - ([TotPrice] * [Discount])Oops, typo below. Should be: [TotalPrice] - ([TotalPrice] * [Discount])
"Bill Hicks" <waylien_no_spam@.yahoo.com> wrote in message
news:uJhvc2lnGHA.4668@.TK2MSFTNGP02.phx.gbl...
> Is there a way to create a calculated column in a table like this, or is
> there a better way to accomplish this task? I've tried, but SQL keeps
> adjusting my precedence and it goofs up the formula:
> Let's say the column name is "NetPrice". I want to deduct the discounted
> amount from the total to arrive at the net price. Discount is a decimal
> value, ie: 25% = .25.
> [TotalPrice] - ([TotPrice] * [Discount])
>|||Bill
See if this helps
CREATE TABLE #Test (
TotalPrice DECIMAL, Discount DECIMAL,
NetPrice AS [TotalPrice] - ([TotalPrice] * [Discount]))
INSERT INTO #Test (TotalPrice,Discount) VALUES (50,15)
SELECT * FROM #Test
"Bill Hicks" <waylien_no_spam@.yahoo.com> wrote in message
news:uJhvc2lnGHA.4668@.TK2MSFTNGP02.phx.gbl...
> Is there a way to create a calculated column in a table like this, or is
> there a better way to accomplish this task? I've tried, but SQL keeps
> adjusting my precedence and it goofs up the formula:
> Let's say the column name is "NetPrice". I want to deduct the discounted
> amount from the total to arrive at the net price. Discount is a decimal
> value, ie: 25% = .25.
> [TotalPrice] - ([TotPrice] * [Discount])
>|||Thanks Uri. I think I was entering something incorrectly when I originally
entered the formula into the table designer.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:ePsmpBmnGHA.764@.TK2MSFTNGP03.phx.gbl...
> Bill
> See if this helps
> CREATE TABLE #Test (
> TotalPrice DECIMAL, Discount DECIMAL,
> NetPrice AS [TotalPrice] - ([TotalPrice] * [Discount]))
>
> INSERT INTO #Test (TotalPrice,Discount) VALUES (50,15)
> SELECT * FROM #Test
>
> "Bill Hicks" <waylien_no_spam@.yahoo.com> wrote in message
> news:uJhvc2lnGHA.4668@.TK2MSFTNGP02.phx.gbl...
>