Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Friday, March 30, 2012

How to create schem

Hello all,
I've always tried to write my SQL script so that they could run
multiple times without error so when I was creating a new schema i get
an error
USE AdventureWorks
GO
IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
CREATE SCHEMA temp AUTHORIZATION dbo
--END IF
GO
this code works
USE AdventureWorks
GO
IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
PRINT 'CREATE SCHEMA temp AUTHORIZATION dbo'
--END IF
GO
and this code works
USE AdventureWorks
GO
CREATE SCHEMA temp AUTHORIZATION dbo
GO
can anyone shed some light on this.
Thanks in advance for your help.
Regards,
HJ
Try something like:
USE AdventureWorks
GO
IF NOT EXISTS(SELECT * FROM sys.schemas where [name] =
'temp')
EXEC('CREATE SCHEMA temp AUTHORIZATION dbo')
-Sue
On 23 Mar 2006 09:26:13 -0800, hanklvr@.yahoo.com wrote:

>Hello all,
>I've always tried to write my SQL script so that they could run
>multiple times without error so when I was creating a new schema i get
>an error
>USE AdventureWorks
>GO
>IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
> CREATE SCHEMA temp AUTHORIZATION dbo
>--END IF
>GO
>this code works
>USE AdventureWorks
>GO
>IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
> PRINT 'CREATE SCHEMA temp AUTHORIZATION dbo'
>--END IF
>GO
>and this code works
>USE AdventureWorks
>GO
>CREATE SCHEMA temp AUTHORIZATION dbo
>GO
>can anyone shed some light on this.
>Thanks in advance for your help.
>Regards,
>HJ

How to create schem

Hello all,
I've always tried to write my SQL script so that they could run
multiple times without error so when I was creating a new schema i get
an error
USE AdventureWorks
GO
IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
CREATE SCHEMA temp AUTHORIZATION dbo
--END IF
GO
this code works
USE AdventureWorks
GO
IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
PRINT 'CREATE SCHEMA temp AUTHORIZATION dbo'
--END IF
GO
and this code works
USE AdventureWorks
GO
CREATE SCHEMA temp AUTHORIZATION dbo
GO
can anyone shed some light on this.
Thanks in advance for your help.
Regards,
HJTry something like:
USE AdventureWorks
GO
IF NOT EXISTS(SELECT * FROM sys.schemas where [name] =
'temp')
EXEC('CREATE SCHEMA temp AUTHORIZATION dbo')
-Sue
On 23 Mar 2006 09:26:13 -0800, hanklvr@.yahoo.com wrote:

>Hello all,
>I've always tried to write my SQL script so that they could run
>multiple times without error so when I was creating a new schema i get
>an error
>USE AdventureWorks
>GO
>IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
> CREATE SCHEMA temp AUTHORIZATION dbo
>--END IF
>GO
>this code works
>USE AdventureWorks
>GO
>IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
> PRINT 'CREATE SCHEMA temp AUTHORIZATION dbo'
>--END IF
>GO
>and this code works
>USE AdventureWorks
>GO
>CREATE SCHEMA temp AUTHORIZATION dbo
>GO
>can anyone shed some light on this.
>Thanks in advance for your help.
>Regards,
>HJ

How to create schem

Hello all,
I've always tried to write my SQL script so that they could run
multiple times without error so when I was creating a new schema i get
an error
USE AdventureWorks
GO
IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
CREATE SCHEMA temp AUTHORIZATION dbo
--END IF
GO
this code works
USE AdventureWorks
GO
IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
PRINT 'CREATE SCHEMA temp AUTHORIZATION dbo'
--END IF
GO
and this code works
USE AdventureWorks
GO
CREATE SCHEMA temp AUTHORIZATION dbo
GO
can anyone shed some light on this.
Thanks in advance for your help.
Regards,
HJTry something like:
USE AdventureWorks
GO
IF NOT EXISTS(SELECT * FROM sys.schemas where [name] ='temp')
EXEC('CREATE SCHEMA temp AUTHORIZATION dbo')
-Sue
On 23 Mar 2006 09:26:13 -0800, hanklvr@.yahoo.com wrote:
>Hello all,
>I've always tried to write my SQL script so that they could run
>multiple times without error so when I was creating a new schema i get
>an error
>USE AdventureWorks
>GO
>IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
> CREATE SCHEMA temp AUTHORIZATION dbo
>--END IF
>GO
>this code works
>USE AdventureWorks
>GO
>IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
> PRINT 'CREATE SCHEMA temp AUTHORIZATION dbo'
>--END IF
>GO
>and this code works
>USE AdventureWorks
>GO
>CREATE SCHEMA temp AUTHORIZATION dbo
>GO
>can anyone shed some light on this.
>Thanks in advance for your help.
>Regards,
>HJ

Wednesday, March 28, 2012

how to create mail merge with word 2003 and sql server 2000 as database

hi, i have the following command and generated an error :
"word was unable to open the data source"

any help will be greatly appreciated.

Thanks in advance.

Jude

Private Sub Command1_Click()

Dim oMainDoc As Word.Document
Dim oSel As Word.Selection
Dim sDBPath As String

'Start a new main document for the mail merge.
Set oMainDoc = oApp.Documents.Add

With oMainDoc.MailMerge

.MainDocumentType = wdFormLetters

.OpenDataSource Name:="", _
connection:="DSN=JLU;DATABASE=PAMI_DB;UID=;pwd=;", _
sqlstatement:="select * from TBLUSERINFO"
'Add the field codes to the document to create the form letter.
With .Fields
Set oSel = oApp.Selection
.Add oSel.Range, "USERID"
oSel.TypeParagraph
.Add oSel.Range, "LASTNAME"
oSel.TypeParagraph
.Add oSel.Range, "FIRSTNAME"
oSel.TypeText ", "
.Add oSel.Range, "MI"
oSel.TypeParagraph
oSel.TypeParagraph
oSel.TypeText "Dear "
.Add oSel.Range, "FULLNAME"
oSel.TypeText ","
oSel.TypeParagraph
oSel.TypeParagraph
oSel.TypeText " This letter is to inform you..."
oSel.TypeParagraph
oSel.TypeParagraph
oSel.TypeText "Sincerely, [Your Name Here]"
End With
End With

'Perform the mail merge to a new document.
With oMainDoc
.MailMerge.Destination = wdSendToNewDocument
.MailMerge.Execute Pause:=False
End With

End SubMake sure your connection string is valid.|||hi, tried this one but no luck again. it gave no error but my computer does not have any activity.

With oMainDoc.MailMerge

.MainDocumentType = wdFormLetters
.OpenDataSource Name:="", _
connection:="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=pami_db;Data Source=JLU", _
sqlstatement:="select * from TBLUSERINFO", SubType:=wdMergeSubTypeWord2000
With .Fields
Set oSel = oApp.Selection
.Add oSel.Range, "USERID"
oSel.TypeParagraph
.Add oSel.Range, "LASTNAME"
oSel.TypeParagraph
.Add oSel.Range, "FIRSTNAME"
oSel.TypeText ", "
.Add oSel.Range, "MI"
oSel.TypeParagraph
oSel.TypeParagraph
oSel.TypeText "Dear "
.Add oSel.Range, "FULLNAME"
oSel.TypeText ","
oSel.TypeParagraph
oSel.TypeParagraph
oSel.TypeText " This letter is to inform you..."
oSel.TypeParagraph
oSel.TypeParagraph
oSel.TypeText "Sincerely, [Your Name Here]"
End With
End With

With oMainDoc
.MailMerge.Destination = wdSendToNewDocument
.MailMerge.Execute Pause:=False
End With

Monday, March 19, 2012

How to create a row that has size greater than 8060

Hi all
When I updated database I got the error message that size of row can't
greater than 8060. Howerver, I think there must be a solution because 8060
is too small. Help me!
ThanksHi
You can ignore the error message and the table will be created although if
the data inserted into the table exceeds the size then the insert will fail.
A table with a size greater than 8060 is a very wide table and you may want
to think about re-designing the database so that you use several tables. You
can create a view that joins these tables if you always wish to avoid joinin
g
the tables "manually".
John
"ghostnguyen" wrote:

> Hi all
> When I updated database I got the error message that size of row can't
> greater than 8060. Howerver, I think there must be a solution because 8060
> is too small. Help me!
> Thanks
>
>|||And all this really, really, really needs to be in a single table? Can you
post some DDL, please?
ML|||Size of a Single row cannot be more than 8060 bytes
Madhivanan|||Create two tables related by a common primary key.
David Portas
SQL Server MVP
--|||Short of redesigning your table (using two tables, for example, as has been
suggested), you may want to consider using [text] instead of long [varchar]
columns. They will be harder to work with, but they are one way to get
around this limitation.
Steve Kass
Drew University
ghostnguyen wrote:

>Hi all
>When I updated database I got the error message that size of row can't
>greater than 8060. Howerver, I think there must be a solution because 8060
>is too small. Help me!
>Thanks
>
>|||If 8060 is too small, seriously look at your database design, or use
datatypes like ntext if you need large text storage.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:DB030F6E-7BA3-4187-817E-EA3FF8088575@.microsoft.com...
> Hi
> You can ignore the error message and the table will be created although if
> the data inserted into the table exceeds the size then the insert will
> fail.
> A table with a size greater than 8060 is a very wide table and you may
> want
> to think about re-designing the database so that you use several tables.
> You
> can create a view that joins these tables if you always wish to avoid
> joining
> the tables "manually".
> John
> "ghostnguyen" wrote:
>

Monday, March 12, 2012

How to create a linked server to MySQL from MsSQL?

I can create a linked server to another MsSQL from MsSQL,but encounter error when create a linked server to MySQL:
Error 7399:OLE DB provider 'MSDASQL' reported an error.
Data source name not found and no default driver specified.
.....
Anyone can help me?
Thanks!try this step,

1. Installed MyODBC driver version for windows,u can download from mysql site
2. Create a system ODBC DSN using this driver to a specific server and database.

3. In SQL Server 2K Enterprise Manager, created a linked server using Microsoft OLE DB Provider for ODBC Drivers and specified the DSN in the Data Source.

and select query should be,

SELECT * FROM OPENQUERY(linkedservername, 'database.table')

or

SELECT * FROM OPENQUERY(linkedservername, 'select * from table)

--cheers,
--http://mallier.blogspot.com|||Yes,I did as you said.But still get this error.

The setting are:
Server Type:Microsoft OLE DB Provider for ODBC
DataSource:mydsn
Provider string:DATABASE=mydb;DSN=mydsn;SERVER=myserver;UID =myuid;PWD=mypwd
Location:myserver
Catalog:mydb

Something is wrong?|||I dont have Mysql here,
try this,

Server Type:Microsoft OLE DB Provider for ODBC
DataSource:mydsn

and remove other properties.

--cheers,
--http://mallier.blogspot.com|||Even I linked to the MsSQL server NOT MySQL,
if put myserver in data source,it's ok.
but if put mydsn in data source,it got same error.|||Sorry,I created dns in wrong location.
After I corrected this mistake,linking to MsSQL is ok,but encountered not responding when link to MySQL.(I've verified that the dsn is ok.)|||I've fixed this problem,it's due to I didn't enable root access from remote machines.
Thanks.

Friday, February 24, 2012

how to correct error on server side

I have a report that uses a stored procedure (DB2). I sometimes get this
error when running certain parameter combinations from the report deployed on
a portal.
"Server Application Unavailable
The web application you are attempting to access on this web server is
currently unavailable. Please hit the "Refresh" button in your web browser to
retry your request.
Administrator Note: An error message detailing the cause of this specific
request failure can be found in the application event log of the web server.
Please review this log entry to discover what caused this error to occur. "
I am not sure where to intercept this. I assume it is coming from the
reporting services server but I dont know where to step in from requesting
the report ... to the execution ... to the display of this rather unfriendly
message. And where do I find the application event log ? Have looked
everywhere on report server for such a log to no avail :-(
Thanks!You might find information in one of the files at: C:\Program
Files\Microsoft SQL Server\MSSQL\Reporting Services\LogFiles
However, the error actually sounds like it comes from ASP.Net, not
Reporting Services. I searched for the error, and there can be many reasons
why this happens. Hope there is something in one of the logs to help you.
--
| Thread-Topic: how to correct error on server side
| thread-index: AcUfV6qsL0pjpLP9THCLVqoegvsWsQ==| X-WBNR-Posting-Host: 192.85.50.2
| From: "=?Utf-8?B?TUogVGFmdA==?=" <MJTaft@.discussions.microsoft.com>
| Subject: how to correct error on server side
| Date: Wed, 2 Mar 2005 10:43:03 -0800
| Lines: 19
| Message-ID: <6E08FFDD-6C09-49DA-AED3-5776FAAB6F67@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.reportingsvcs
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTCMTY1.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.reportingsvcs:44361
| X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
|
| I have a report that uses a stored procedure (DB2). I sometimes get this
| error when running certain parameter combinations from the report
deployed on
| a portal.
|
| "Server Application Unavailable
| The web application you are attempting to access on this web server is
| currently unavailable. Please hit the "Refresh" button in your web
browser to
| retry your request.
| Administrator Note: An error message detailing the cause of this specific
| request failure can be found in the application event log of the web
server.
| Please review this log entry to discover what caused this error to occur.
"
|
| I am not sure where to intercept this. I assume it is coming from the
| reporting services server but I dont know where to step in from
requesting
| the report ... to the execution ... to the display of this rather
unfriendly
| message. And where do I find the application event log ? Have looked
| everywhere on report server for such a log to no avail :-(
|
| Thanks!
||||Thanks for the reply Brad. I have looked in the log files in the reporting
services location and should have put that in my initial post. There was
nothing there to help with this. I did see something in the system app event
log stating something like aspnet_wp.exe stopped unexpectedly but it didnt
give any more info than that. Also ... I have noticed in this newgroup that
there are several people that seem to be getting that error message however I
have not seen many suggestions as to how to correct it or where it comes
from. I will keep hoping that someone will help. Thanks.
""Brad Syputa - MS"" wrote:
> You might find information in one of the files at: C:\Program
> Files\Microsoft SQL Server\MSSQL\Reporting Services\LogFiles
> However, the error actually sounds like it comes from ASP.Net, not
> Reporting Services. I searched for the error, and there can be many reasons
> why this happens. Hope there is something in one of the logs to help you.
> --
> | Thread-Topic: how to correct error on server side
> | thread-index: AcUfV6qsL0pjpLP9THCLVqoegvsWsQ==> | X-WBNR-Posting-Host: 192.85.50.2
> | From: "=?Utf-8?B?TUogVGFmdA==?=" <MJTaft@.discussions.microsoft.com>
> | Subject: how to correct error on server side
> | Date: Wed, 2 Mar 2005 10:43:03 -0800
> | Lines: 19
> | Message-ID: <6E08FFDD-6C09-49DA-AED3-5776FAAB6F67@.microsoft.com>
> | MIME-Version: 1.0
> | Content-Type: text/plain;
> | charset="Utf-8"
> | Content-Transfer-Encoding: 7bit
> | X-Newsreader: Microsoft CDO for Windows 2000
> | Content-Class: urn:content-classes:message
> | Importance: normal
> | Priority: normal
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | Newsgroups: microsoft.public.sqlserver.reportingsvcs
> | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
> | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTCMTY1.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.reportingsvcs:44361
> | X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
> |
> | I have a report that uses a stored procedure (DB2). I sometimes get this
> | error when running certain parameter combinations from the report
> deployed on
> | a portal.
> |
> | "Server Application Unavailable
> | The web application you are attempting to access on this web server is
> | currently unavailable. Please hit the "Refresh" button in your web
> browser to
> | retry your request.
> | Administrator Note: An error message detailing the cause of this specific
> | request failure can be found in the application event log of the web
> server.
> | Please review this log entry to discover what caused this error to occur.
> "
> |
> | I am not sure where to intercept this. I assume it is coming from the
> | reporting services server but I dont know where to step in from
> requesting
> | the report ... to the execution ... to the display of this rather
> unfriendly
> | message. And where do I find the application event log ? Have looked
> | everywhere on report server for such a log to no avail :-(
> |
> | Thanks!
> |
>