Showing posts with label wrong. Show all posts
Showing posts with label wrong. Show all posts

Saturday, February 25, 2012

creating a database in SQL 2005 - using windows 2003

when i try to create a new database i get a error: The server could not
load DCOM

what is wrong and how can i fix it?

i have updated mssql/win 2003 with the lates updates

Rgds

BobbyHi Bobby

This usually has something to do with user permissions. Please ensure
that your database login has permissions to create new databases. Also
ensure that you have sufficient Windows user permissions to the
directory where SQL Server is trying to create the .mdf and the .ldf
file.

Cheers
Louis

Tuesday, February 14, 2012

Create View in SQL Server with data types

I need to create a view of a sql table, but change the data types. I know
the syntax below is not correct, and can't figure out if it is wrong or if
you just can't do this. I have only created views before with the same data
type.

CREATE VIEW F0005New(DRKY nchar(3), DRDL01 nchar(30))
INSERT (SELECT rtrim(F0005.DRKY), F0005.DRDL01
FROM F0005 AS F0005
WHERE DRSY = '41' AND DRRT = 'S1')

Thanks!!Aren't those JD Edwards column names a drag? I'm surprised you need
UNICODE (nchar and nvarchar instead of char and varchar), I did not
realize that JDE could handle anything beyond EBCDIC or ASCII.

A VIEW is just a SELECT statement inside. The example has an INSERT
statement. A VIEW can NOT have an INSERT statement.

CREATE VIEW does not allow for specifying the data types in the VIEW
column list. It is not part of the syntax.

When I need to control the data type this way I use CONVERT, though
CASE can do the same thing:

CREATE VIEW F0005New
AS
SELECT CONVERT(nhcar(3), rtrim(F0005.DRKY)) as DRKY,
CONVERT(nchar(30), F0005.DRDL01) as DRDL01
FROM F0005
WHERE DRSY = '41'
AND DRRT = 'S1'

Roy Harvey
Beacon Falls, CT

On Mon, 14 Aug 2006 15:58:01 GMT, "cognosqueen" <u25284@.uwewrote:

Quote:

Originally Posted by

>I need to create a view of a sql table, but change the data types. I know
>the syntax below is not correct, and can't figure out if it is wrong or if
>you just can't do this. I have only created views before with the same data
>type.
>
>CREATE VIEW F0005New(DRKY nchar(3), DRDL01 nchar(30))
>INSERT (SELECT rtrim(F0005.DRKY), F0005.DRDL01
>FROM F0005 AS F0005
>WHERE DRSY = '41' AND DRRT = 'S1')
>
>Thanks!!

|||Roy - thanks so much!!! You are right about the JE Edwards column names!! I
do not enjoy them at all. Regarding the data type - the client already had
it set up - I just have to live with it!! I'll try this and see if it works!

Roy Harvey wrote:

Quote:

Originally Posted by

>Aren't those JD Edwards column names a drag? I'm surprised you need
>UNICODE (nchar and nvarchar instead of char and varchar), I did not
>realize that JDE could handle anything beyond EBCDIC or ASCII.
>
>A VIEW is just a SELECT statement inside. The example has an INSERT
>statement. A VIEW can NOT have an INSERT statement.
>
>CREATE VIEW does not allow for specifying the data types in the VIEW
>column list. It is not part of the syntax.
>
>When I need to control the data type this way I use CONVERT, though
>CASE can do the same thing:
>
>CREATE VIEW F0005New
>AS
>SELECT CONVERT(nhcar(3), rtrim(F0005.DRKY)) as DRKY,
CONVERT(nchar(30), F0005.DRDL01) as DRDL01
FROM F0005
WHERE DRSY = '41'
AND DRRT = 'S1'
>
>Roy Harvey
>Beacon Falls, CT
>

Quote:

Originally Posted by

>>I need to create a view of a sql table, but change the data types. I know
>>the syntax below is not correct, and can't figure out if it is wrong or if


>[quoted text clipped - 7 lines]

Quote:

Originally Posted by

>>
>>Thanks!!

|||Roy - it worked! Thanks for your help.

cognosqueen wrote:

Quote:

Originally Posted by

>Roy - thanks so much!!! You are right about the JE Edwards column names!! I
>do not enjoy them at all. Regarding the data type - the client already had
>it set up - I just have to live with it!! I'll try this and see if it works!
>

Quote:

Originally Posted by

>>Aren't those JD Edwards column names a drag? I'm surprised you need
>>UNICODE (nchar and nvarchar instead of char and varchar), I did not


>[quoted text clipped - 25 lines]

Quote:

Originally Posted by

Quote:

Originally Posted by

>>>
>>>Thanks!!

|||You are welcome, and good luck! My experience with importing JD
Edwards data into a SQL Server data warehouse was quite painful, not
because of F0005 which in our case was quite clean, but the invoice
data that came in lacked any unique key. I hope your life is simpler
than mine was.

Roy

On Mon, 14 Aug 2006 18:37:37 GMT, "cognosqueen" <u25284@.uwewrote:

Quote:

Originally Posted by

>Roy - it worked! Thanks for your help.
>
>cognosqueen wrote:

Quote:

Originally Posted by

>>Roy - thanks so much!!! You are right about the JE Edwards column names!! I
>>do not enjoy them at all. Regarding the data type - the client already had
>>it set up - I just have to live with it!! I'll try this and see if it works!
>>

Quote:

Originally Posted by

>>>Aren't those JD Edwards column names a drag? I'm surprised you need
>>>UNICODE (nchar and nvarchar instead of char and varchar), I did not


>>[quoted text clipped - 25 lines]

Quote:

Originally Posted by

>>>>
>>>>Thanks!!

Create view "disconnected" (correct group this time)

Oops, I accidentally put this in the wrong newsgroup the first time. I
think this is a better location. Sorry for the double-post.
I occasionally need to create or alter a view that references a linked
server, where the linked server is not currently online (or my Internet
connection is not currently connected, or whatever).
An "Alter View" statement that references a linked server name will fail
with "Could not find server", "Login Failed" or other errors, if the server
is not accessible at the moment.
I sometimes don't care about this problem at the time that I *define* the
view (or stored procedure, or user-defined function); when I *run* the
view, procedure, or function, the linked server will be there, and things
will work.
I can't find how to get around this, which seems like a limitation of the
"Create View" and "Alter View" commands.
Thanks for any suggestions.
David Walker
Well, I replied in microsoft.public.sqlserver.server. - RLF
"DWalker" <none@.none.com> wrote in message
news:eRW7s8g1HHA.4584@.TK2MSFTNGP03.phx.gbl...
> Oops, I accidentally put this in the wrong newsgroup the first time. I
> think this is a better location. Sorry for the double-post.
>
> I occasionally need to create or alter a view that references a linked
> server, where the linked server is not currently online (or my Internet
> connection is not currently connected, or whatever).
> An "Alter View" statement that references a linked server name will fail
> with "Could not find server", "Login Failed" or other errors, if the
> server
> is not accessible at the moment.
> I sometimes don't care about this problem at the time that I *define* the
> view (or stored procedure, or user-defined function); when I *run* the
> view, procedure, or function, the linked server will be there, and things
> will work.
> I can't find how to get around this, which seems like a limitation of the
> "Create View" and "Alter View" commands.
> Thanks for any suggestions.
> David Walker
|||Hi David,
You can continue the communications under your other post in
microsoft.public.sqlserver.server. You are guaranteed to get Microsoft
assistance in MSDN managed newsgroup.
If you have any other questions or concerns, please feel free to let us
know.
Best regards,
Charles Wang
Microsoft Online Community Support
================================================== ===
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====

Create view "disconnected" (correct group this time)

Oops, I accidentally put this in the wrong newsgroup the first time. I
think this is a better location. Sorry for the double-post.
I occasionally need to create or alter a view that references a linked
server, where the linked server is not currently online (or my Internet
connection is not currently connected, or whatever).
An "Alter View" statement that references a linked server name will fail
with "Could not find server", "Login Failed" or other errors, if the server
is not accessible at the moment.
I sometimes don't care about this problem at the time that I *define* the
view (or stored procedure, or user-defined function); when I *run* the
view, procedure, or function, the linked server will be there, and things
will work.
I can't find how to get around this, which seems like a limitation of the
"Create View" and "Alter View" commands.
Thanks for any suggestions.
David WalkerWell, I replied in microsoft.public.sqlserver.server. - RLF
"DWalker" <none@.none.com> wrote in message
news:eRW7s8g1HHA.4584@.TK2MSFTNGP03.phx.gbl...
> Oops, I accidentally put this in the wrong newsgroup the first time. I
> think this is a better location. Sorry for the double-post.
>
> I occasionally need to create or alter a view that references a linked
> server, where the linked server is not currently online (or my Internet
> connection is not currently connected, or whatever).
> An "Alter View" statement that references a linked server name will fail
> with "Could not find server", "Login Failed" or other errors, if the
> server
> is not accessible at the moment.
> I sometimes don't care about this problem at the time that I *define* the
> view (or stored procedure, or user-defined function); when I *run* the
> view, procedure, or function, the linked server will be there, and things
> will work.
> I can't find how to get around this, which seems like a limitation of the
> "Create View" and "Alter View" commands.
> Thanks for any suggestions.
> David Walker|||Hi David,
You can continue the communications under your other post in
microsoft.public.sqlserver.server. You are guaranteed to get Microsoft
assistance in MSDN managed newsgroup.
If you have any other questions or concerns, please feel free to let us
know.
Best regards,
Charles Wang
Microsoft Online Community Support
========================================
=============
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
========================================
==============
This posting is provided "AS IS" with no warranties, and confers no rights.
========================================
==============