Showing posts with label everybody. Show all posts
Showing posts with label everybody. Show all posts

Wednesday, March 28, 2012

Problems in Creating Views in Sql

Hi everybody,
I have couple of Access databases needed to be
converted to access/Sql Client/Server database, which is new to me. I
am trying to convert my access quries to Sql Views or Stored
Procedures. I have run into a problem currently when creating view in
Sql:
I need to create some columns based on conditions of other columns,
for example:
1. Column example 1:
IIf([Column1]=-1,[ListPrice]*[Volume],IIf([Column2]=-1,0,[ListPrice]*Volume]))
2. Column example 2:
IIf(Len([Product].[P_No])<10,"",SUBSTRING([Product].[P_No],6,5))
3.Column example 3:
IIf([CustType]="D",([Field1]+[Field2])*[Volume],Field1*Volume)
The above are actually the columns that I need to create.
I have these functions built in Access Queries, but not sure how to
build them in Sql views. Have tried different ways, but failed.
Any body knows how to do it?
Any help will be greatly appreciated!
Thanks in advance!"Shelley" <schow@.hersheys.com> wrote in message
news:e085e628.0402020838.450efcdc@.posting.google.com...
> 3.Column example 3:
> IIf([CustType]="D",([Field1]+[Field2])*[Volume],Field1*Volume)
Take a look at the CASE statement in the online help.|||"Freddy" <noemail@.noemail> wrote in message news:<OT0rBBb6DHA.2524@.TK2MSFTNGP11.phx.gbl>...
> "Shelley" <schow@.hersheys.com> wrote in message
> news:e085e628.0402020838.450efcdc@.posting.google.com...
> > 3.Column example 3:
> > IIf([CustType]="D",([Field1]+[Field2])*[Volume],Field1*Volume)
> Take a look at the CASE statement in the online help.
Thanks Freddy.
This one works.

Problems in Creating Views in Sql

Hi everybody,
I have couple of Access databases needed to be
converted to access/Sql Client/Server database, which is new to me. I
am trying to convert my access quries to Sql Views or Stored
Procedures. I have run into a problem currently when creating view in
Sql:
I need to create some columns based on conditions of other columns,
for example:
1. Column example 1:
IIf([Column1]=-1,[ListPrice]*[Volume],IIf([Column2]=-1,0,[ListPrice]*Volume]))
2. Column example 2:
IIf(Len([Product].[P_No])<10,"",SUBSTRING([Product].[P_No],6,5))
3.Column example 3:
IIf([CustType]="D" ,([Field1]+[Field2])*[Volume],Field1*Vol
ume)
The above are actually the columns that I need to create.
I have these functions built in Access Queries, but not sure how to
build them in Sql views. Have tried different ways, but failed.
Any body knows how to do it?
Any help will be greatly appreciated!
Thanks in advance!"Shelley" <schow@.hersheys.com> wrote in message
news:e085e628.0402020838.450efcdc@.posting.google.com...
quote:

> 3.Column example 3:
> IIf([CustType]="D" ,([Field1]+[Field2])*[Volume],Field1*Vol
ume)

Take a look at the CASE statement in the online help.|||"Freddy" <noemail@.noemail> wrote in message news:<OT0rBBb6DHA.2524@.TK2MSFTNGP11.phx.gbl>...
quote:


> "Shelley" <schow@.hersheys.com> wrote in message
> news:e085e628.0402020838.450efcdc@.posting.google.com...
> Take a look at the CASE statement in the online help.

Thanks Freddy.
This one works.

Monday, March 26, 2012

problems downloading Microsoft SQL Server Management Studio Express

I everybody,

I'm trying to download Microsoft SQL Server Management Studio Express from

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796

However, the download never finishs.

If I try to download using a download manager it stops after 98% (the segment that stops is the first segment).
If I try to download without a download manager it stops after 1% (456Kb).

What can I do?

Is there an alternate place where I can download the file?

Thanks,

Nadav

You're in the right place - try it from another network connection, and then copy the file to the first server. I just tested it and it downloads successfully from here.

Buck Woody

|||

Hi Buck,

I've managed to download it from another computer

(it was also several days later, so I don't know if the problem was related to the computer or if it was temporary).

Thanks anyway,

Nadav

|||

Good to hear. Let us know if we can be of any help.

Buck

problems downloading Microsoft SQL Server Management Studio Express

I everybody,

I'm trying to download Microsoft SQL Server Management Studio Express from

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796

However, the download never finishs.

If I try to download using a download manager it stops after 98% (the segment that stops is the first segment).
If I try to download without a download manager it stops after 1% (456Kb).

What can I do?

Is there an alternate place where I can download the file?

Thanks,

Nadav

You're in the right place - try it from another network connection, and then copy the file to the first server. I just tested it and it downloads successfully from here.

Buck Woody

|||

Hi Buck,

I've managed to download it from another computer

(it was also several days later, so I don't know if the problem was related to the computer or if it was temporary).

Thanks anyway,

Nadav

|||

Good to hear. Let us know if we can be of any help.

Buck

Monday, March 12, 2012

Problemm setting permissions

Hello everybody,
I ran into a strange kind of problem in SQL2K. I tryto give a user
select permissions on fn_trace_getinfo, but then I apply the new
permissions I get the message "Invalid object name
system_functionschema.fn_trace_getinfo". How is this possible. I see
the function and as sysadmin I can use it, but when you try to change
permissions it says the object doesn't exist ?
Does anybody know why this is happening and if there is some way
around.
Tia MarkusHi
fn_trace_getinfo is a system function.
What happaned if the user run
SELECT *
FROM ::fn_trace_getinfo(trace_id)
WHERE Property=4
<m.bohse@.quest-consultants.com> wrote in message
news:1136540572.050234.16160@.g14g2000cwa.googlegroups.com...
> Hello everybody,
> I ran into a strange kind of problem in SQL2K. I tryto give a user
> select permissions on fn_trace_getinfo, but then I apply the new
> permissions I get the message "Invalid object name
> system_functionschema.fn_trace_getinfo". How is this possible. I see
> the function and as sysadmin I can use it, but when you try to change
> permissions it says the object doesn't exist ?
> Does anybody know why this is happening and if there is some way
> around.
> Tia Markus
>

Saturday, February 25, 2012

Problem with using 'OutPut Clause' in SQL SEERVER 2005

Hi everyBody,

I Tried to use "OutPut" clause in insert statment as fallows:

insert into test

OUTPUT Inserted.Name,Inserted.LastName

values ('John','kransky')

The Error:

Line 2: Incorrect syntax near 'OUTPUT'.

but I face with this error,I checked MSDN and the other sources, it seems everything is ok. But when I run it ,I face with that error message.I would be appriciate if someone help me on it.

OUTPUT values MUST be 'captured' in some fashion. Typically, the OUTPUT values are captured in a @.Temp table.

For Example, this might work for you:

Code Snippet

DECLARE @.NewRows table

( [Name] varchar(20),

LastName varchar(20)

);

INSERT INTO Test

OUTPUT Inserted.Name, Inserted.LastName

INTO @.NewRows

VALUES ( 'John', 'kransky' );

Then you can use the data in the @.NewRows table however you wish.

Problem with using ''OutPut Clause'' in SQL SEERVER 2005

Hi everyBody,

I Tried to use "OutPut" clause in insert statment as fallows:

insert into test

OUTPUT Inserted.Name,Inserted.LastName

values ('John','kransky')

The Error:

Line 2: Incorrect syntax near 'OUTPUT'.

but I face with this error,I checked MSDN and the other sources, it seems everything is ok. But when I run it ,I face with that error message.I would be appriciate if someone help me on it.

OUTPUT values MUST be 'captured' in some fashion. Typically, the OUTPUT values are captured in a @.Temp table.

For Example, this might work for you:

Code Snippet

DECLARE @.NewRows table

( [Name] varchar(20),

LastName varchar(20)

);

INSERT INTO Test

OUTPUT Inserted.Name, Inserted.LastName

INTO @.NewRows

VALUES ( 'John', 'kransky' );

Then you can use the data in the @.NewRows table however you wish.

problem with using linked server

:) hello everybody, i am using oracle as linked derver to my sql server db...when i write the query to access data from linked server(oracle) iam getting error like this...iam helpless..pls give ur ideas..
my query is: SELECT * FROM EOPI..EOP.CONTRACT
and the error is
OLE DB provider 'OraOLEDB.Oracle' reported an error.
[OLE/DB provider returned message: ORA-12638: Credential retrieval failed]..

thax and regards
kiran
senior software engineer :cool:When querying by linked server you have to use openquery.

SELECT * FROM OPENQUERY(linkedservername,'SELECT * FROM pubs')