Showing posts with label created. Show all posts
Showing posts with label created. Show all posts

Wednesday, March 28, 2012

microsoft sql server 2000

i wanted to restore user DB from one sql server to another sql server ,
one database is having so many table and have user called digi
he is created so many SP and some tables., when i restore the db it
restored without any problem.,

after restoring application is not working

how to ensure that restored DB is having same security as the original
for that user .

when i tried to run the script of that db over that restored DB

it was showing user digi does not exist. but i have creted user digi

where can i get the useful information about this

/sreeni

--
srin

Posted via http://dbforums.comUytkownik "sreenivasa" <member32738@.dbforums.com> napisa w wiadomoci
news:3084542.1057641115@.dbforums.com...
> i wanted to restore user DB from one sql server to another sql server ,
<cut>
It's probably your answer - another sql so it means another master database.
You have user account in database wich was restored, but you do not have
user login (in master database - sysusers table) wich is connected to
database account.
You must drop database user and create new login - not recomended, or use
sp_change_users_login with Auto_Fix option.
regards
Marcin D

Monday, March 26, 2012

Microsoft OLEDB provider for DB2 performance issue (Missing where clause on DB2 site)

Hi!

I have just installed Microsoft OLEDB provider for DB2 on a SQL server 2005. I created a Linked server against our DB2 V.8 Z/OS database. I tested the connection via execution of a simple select call, something like:

SELECT FIELD_A FROM DB2SRV.DB2DB.CREATOR_A.TABLE_A

WHERE FIELD_A='ABC'

I traced the call on the DB2 site. The SQL running on DB2 site was to my surprise without the “where clause”:

SELECT FIELD_A FROM DB2DB.CREATOR_A.TABLE_A

So, all rows are moved to SQL server before the where clause is executed, resulting in bad performance. The index on FIELD_A is not used and so on … !

If anyone out there has an idea of what could be wrong, please let me know!

NB. I know that by using OPENQUERY pass-through query, all execution is done on the DB2 site.

Moving to engine to resolve linked server specific issues. With regard to the driver, this blog is probably the place to go for experts on the driver itself:

http://blogs.msdn.com/dotnetinterop/archive/2006/01/19/514702.aspx

Hope this helps,

John

|||

Thanks !

The specific blog reference you gave me didn’t have any answers. But do you suggest that a raise my problem here ?

Brgds Henrik

|||If you are using WHERE clauses, you mihgt have to set the "Dervie Parameters", initialization property of the OLE DB data source to TRUE. It will instruct the provider to derive parameter info from the data source. I think you det it in the Advanced Options page of the Data Source Wizard, or maybe in the Data Links dialog. You might have to set it in the initialization string.|||

Fyi ! I have solved the problem myself. By setting option “collation compatible” to true, the where clause was executed on the DB2 site.

The option can be changed via Microsoft SQL Server Management Studio - linked servers “properties” and “server options” or by executing :

EXEC master.dbo.sp_serveroption @.server=N'DB2TSRV', @.optname=N'collation compatible', @.optvalue=N'true'

Henrik Garde

Microsoft OLEDB provider for DB2 performance issue (Missing where clause on DB2 site)

Hi!

I have just installed Microsoft OLEDB provider for DB2 on a SQL server 2005. I created a Linked server against our DB2 V.8 Z/OS database. I tested the connection via execution of a simple select call, something like:

SELECT FIELD_A FROM DB2SRV.DB2DB.CREATOR_A.TABLE_A

WHERE FIELD_A='ABC'

I traced the call on the DB2 site. The SQL running on DB2 site was to my surprise without the “where clause”:

SELECT FIELD_A FROM DB2DB.CREATOR_A.TABLE_A

So, all rows are moved to SQL server before the where clause is executed, resulting in bad performance. The index on FIELD_A is not used and so on … !

If anyone out there has an idea of what could be wrong, please let me know!

NB. I know that by using OPENQUERY pass-through query, all execution is done on the DB2 site.

Moving to engine to resolve linked server specific issues. With regard to the driver, this blog is probably the place to go for experts on the driver itself:

http://blogs.msdn.com/dotnetinterop/archive/2006/01/19/514702.aspx

Hope this helps,

John

|||

Thanks !

The specific blog reference you gave me didn’t have any answers. But do you suggest that a raise my problem here ?

Brgds Henrik

|||If you are using WHERE clauses, you mihgt have to set the "Dervie Parameters", initialization property of the OLE DB data source to TRUE. It will instruct the provider to derive parameter info from the data source. I think you det it in the Advanced Options page of the Data Source Wizard, or maybe in the Data Links dialog. You might have to set it in the initialization string.|||

Fyi ! I have solved the problem myself. By setting option “collation compatible” to true, the where clause was executed on the DB2 site.

The option can be changed via Microsoft SQL Server Management Studio - linked servers “properties” and “server options” or by executing :

EXEC master.dbo.sp_serveroption @.server=N'DB2TSRV', @.optname=N'collation compatible', @.optvalue=N'true'

Henrik Garde

Microsoft OLEDB provider for DB2 performance issue (Missing where clause on DB2 site)

Hi!

I have just installed Microsoft OLEDB provider for DB2 on a SQL server 2005. I created a Linked server against our DB2 V.8 Z/OS database. I tested the connection via execution of a simple select call, something like:

SELECT FIELD_A FROM DB2SRV.DB2DB.CREATOR_A.TABLE_A

WHERE FIELD_A='ABC'

I traced the call on the DB2 site. The SQL running on DB2 site was to my surprise without the “where clause”:

SELECT FIELD_A FROM DB2DB.CREATOR_A.TABLE_A

So, all rows are moved to SQL server before the where clause is executed, resulting in bad performance. The index on FIELD_A is not used and so on … !

If anyone out there has an idea of what could be wrong, please let me know!

NB. I know that by using OPENQUERY pass-through query, all execution is done on the DB2 site.

Moving to engine to resolve linked server specific issues. With regard to the driver, this blog is probably the place to go for experts on the driver itself:

http://blogs.msdn.com/dotnetinterop/archive/2006/01/19/514702.aspx

Hope this helps,

John

|||

Thanks !

The specific blog reference you gave me didn’t have any answers. But do you suggest that a raise my problem here ?

Brgds Henrik

|||If you are using WHERE clauses, you mihgt have to set the "Dervie Parameters", initialization property of the OLE DB data source to TRUE. It will instruct the provider to derive parameter info from the data source. I think you det it in the Advanced Options page of the Data Source Wizard, or maybe in the Data Links dialog. You might have to set it in the initialization string.|||

Fyi ! I have solved the problem myself. By setting option “collation compatible” to true, the where clause was executed on the DB2 site.

The option can be changed via Microsoft SQL Server Management Studio - linked servers “properties” and “server options” or by executing :

EXEC master.dbo.sp_serveroption @.server=N'DB2TSRV', @.optname=N'collation compatible', @.optvalue=N'true'

Henrik Garde

Friday, March 23, 2012

Microsoft OLE DB Provider for ODBC Drivers

I am using an system ODBC created to access data on an AS/400.
I can access the data fine, using the following query.
SELECT F0101.* FROM CRPDTA.PILGRIM.CRPDTA.F0101 as F0101
where the first CRPDTA is the DSN name, PILGRIM is the AS/400 catalog,
the second CRPDTA is the SCHEMA, and F0101 is the file name.
When I try to save this query as a view, I receive the following error.
The operation could not be performed because the OLE DB provider
'MSDASQL' was unable to begin a distributed transaction.
[OLE/DB provider returned message: [IBM][Client Access Express ODBC
Driver (32-bit)]Option type out of range.]
OLE DB error trace [OLE/DB Provider 'MSDASQL'
ITransactionJoin::JoinTransaction returned 0x8004d00a]
Can anyone help?
PMGBoy
On several occasion a bug in the ODBC driver causes all sorts of problem
in the client. Try using any third party software, such as WinSQL
(http://synametrics.com/winsql) and see if you get the same behavior.
This would eliminate the possibility of a buggy driver.
jeff.jones@.papermagic.com wrote:
> I am using an system ODBC created to access data on an AS/400.
> I can access the data fine, using the following query.
> SELECT F0101.* FROM CRPDTA.PILGRIM.CRPDTA.F0101 as F0101
> where the first CRPDTA is the DSN name, PILGRIM is the AS/400 catalog,
> the second CRPDTA is the SCHEMA, and F0101 is the file name.
> When I try to save this query as a view, I receive the following error.
> The operation could not be performed because the OLE DB provider
> 'MSDASQL' was unable to begin a distributed transaction.
> [OLE/DB provider returned message: [IBM][Client Access Express ODBC
> Driver (32-bit)]Option type out of range.]
> OLE DB error trace [OLE/DB Provider 'MSDASQL'
> ITransactionJoin::JoinTransaction returned 0x8004d00a]
> Can anyone help?
> PMGBoy
>

Microsoft OLE DB Provider for ODBC Drivers

I am using an system ODBC created to access data on an AS/400.
I can access the data fine, using the following query.
SELECT F0101.* FROM CRPDTA.PILGRIM.CRPDTA.F0101 as F0101
where the first CRPDTA is the DSN name, PILGRIM is the AS/400 catalog,
the second CRPDTA is the SCHEMA, and F0101 is the file name.
When I try to save this query as a view, I receive the following error.
The operation could not be performed because the OLE DB provider
'MSDASQL' was unable to begin a distributed transaction.
[OLE/DB provider returned message: [IBM][Client Access Express O
DBC
Driver (32-bit)]Option type out of range.]
OLE DB error trace [OLE/DB Provider 'MSDASQL'
ITransactionJoin::JoinTransaction returned 0x8004d00a]
Can anyone help?
PMGBoyOn several occasion a bug in the ODBC driver causes all sorts of problem
in the client. Try using any third party software, such as WinSQL
(http://synametrics.com/winsql) and see if you get the same behavior.
This would eliminate the possibility of a buggy driver.
jeff.jones@.papermagic.com wrote:
> I am using an system ODBC created to access data on an AS/400.
> I can access the data fine, using the following query.
> SELECT F0101.* FROM CRPDTA.PILGRIM.CRPDTA.F0101 as F0101
> where the first CRPDTA is the DSN name, PILGRIM is the AS/400 catalog,
> the second CRPDTA is the SCHEMA, and F0101 is the file name.
> When I try to save this query as a view, I receive the following error.
> The operation could not be performed because the OLE DB provider
> 'MSDASQL' was unable to begin a distributed transaction.
> [OLE/DB provider returned message: [IBM][Client Access Express
ODBC
> Driver (32-bit)]Option type out of range.]
> OLE DB error trace [OLE/DB Provider 'MSDASQL'
> ITransactionJoin::JoinTransaction returned 0x8004d00a]
> Can anyone help?
> PMGBoy
>sql

Wednesday, March 21, 2012

Microsoft Enterprise Manager cannot "see" an instance of Microsoft MSDE-SQL - Server

Hello,
i have following Problem:
i have created a new instance of Microsoft SQL - Server with MSDE and now i
want to connect to a database on this instance through a network.
But i do not "see" the instance ...
I have tested it with
- Enterprise Manager
- an Microsoft Access .adp - Project
- MSDE+ SQL-Server Management Tool
Also: The server is started, this was my first look up .....
Who can help me'
Thanks in the beginning ...
PeterHi
Have a look at
http://support.microsoft.com/default.aspx?scid=kb;en-us;814130
and
http://support.microsoft.com/default.aspx?scid=kb;en-us;827204
Regards
Mike
"stundner@.oca.at" wrote:
> Hello,
> i have following Problem:
> i have created a new instance of Microsoft SQL - Server with MSDE and now i
> want to connect to a database on this instance through a network.
> But i do not "see" the instance ...
> I have tested it with
> - Enterprise Manager
> - an Microsoft Access .adp - Project
> - MSDE+ SQL-Server Management Tool
> Also: The server is started, this was my first look up .....
>
> Who can help me'
>
> Thanks in the beginning ...
> Peter
>
>

Monday, March 19, 2012

Microsoft Access Security

I HAVE CREATED A SECURITY DATABASE USING A NEW WORKGROUP FILE WITH A NEW MDW FILE NAME. THE DATABASE ITSELF CONTAINS SEVERAL GROUPS OF USERS AND SEVERAL USERS. THE DATABASE WORKS AS DESIGNED.
THE PROBLEMS IS IF I OPEN THIS DATABASE USING THE SYSTEM.MDW FILE, THE DATABASE OPENS AND GIVE ME COMPLETE ACCESS TO EVERYTHING.

CAN ANYONE EXPLAIN WHAT IS HAPPENING.

ANY HELP WILL BE APPRECIATED

THANKING YOU IN ADVANCE

JOSEPH FORDDid you give the user Admin a password?

Did you join to the workgroup?|||Originally posted by Brett Kaiser
Did you give the user Admin a password?

Did you join to the workgroup?
I gave the admin a password and then created a new administer with a different name.

When I open the database with the workgroup I created it works fine.
but when I open the database with the system.mdw workgroup it allow me to enter the database. which should not be. I am missing something.

Thanks|||And it doesn't ask you for a password, right?|||Originally posted by Brett Kaiser
And it doesn't ask you for a password, right?

Yes that is correct. The following information I found in Q/A section. What do you make of this.
10. Additionally, you may need manually to remove the Open/Run permission from the database container for the Users group through the security menus or through code. This will prevent someone from opening the database by using another workgroup information file or the default System.mda/mdw. In Microsoft Access 97, the User Level Security Wizard is supposed to remove the Open/Run database permissions for the Users group, but fails to do so. The Access 2000 Security Wizard removes permissions to the point where they are not visible on the security menus, but testing has revealed that in Access 2000 it is possible to open a database by using the default workgroup information file regardless of the menu settings. The cure for both versions of Access is to create a new, empty database while logged on as a member of the Admins group and import all of the objects from the secured database. You should take this step before spending too much time securing objects because Access considers imported objects to be new and loses the permission information that was stored in the source database.|||Yeah..it's a toy...

Don't use the default workgroup...

But you said you removed all of the permissions from Admin (that's what it's opening with), but it doesn't seem to be the case...

You sure your removed Admin from the Admin group?

And made sure it had no permissions?|||Originally posted by Brett Kaiser
Yeah..it's a toy...

Don't use the default workgroup...

But you said you removed all of the permissions from Admin (that's what it's opening with), but it doesn't seem to be the case...

You sure your removed Admin from the Admin group?

And made sure it had no permissions?

I think I have but could be wrong. I have attached a file that I would appreciate your looking at to see if you can see the problelm.

Thanks for your help

Joe Ford|||I think you forgot the attachment...|||Originally posted by Brett Kaiser
I think you forgot the attachment...

Your are right. I have attached it now. Please forgive my senior memo.|||OK,

How about what he permissions are fopr the user group...|||Originally posted by Brett Kaiser
OK,

How about what he permissions are fopr the user group...

ALL USERS ARE PART OF THE USER GROUP AND THAT GROUP HAS NO PERMISSION AT ALL INCLUDING ADMIN.|||Yeah...I figured as much...

Who is the owner of all the objects...Where they all originally created by Admin?|||Originally posted by Brett Kaiser
Yeah...I figured as much...

Who is the owner of all the objects...Where they all originally created by Admin?

Owner is Poweradmin see attached|||What about the other objects (like tables, macros, ect)...don't know if dbowner does it...I think it should...

who owns them?|||Originally posted by Brett Kaiser
What about the other objects (like tables, macros, ect)...don't know if dbowner does it...I think it should...

who owns them?

they are all owned by poweradmin|||Make sure u encrypt ur database using workgroup information file

Also inform u are whitout knowing that even if u create particular
security file for an access database .. .Users group which is default to any *.mdw file will be created and access won't allow u to delete it ...

however make sure you didn't grant any permission to this group

regards ...

Monday, March 12, 2012

MFC CDatabase and ODBC version

Hi all,

I created a CDatabase object, called OpenEx and checked the ODBC version with:

unsigned int version;

SQLGetEnvAttr(AfxGetHENV(),SQL_ATTR_ODBC_VERSION,&version,0,0);

and the version is 2. I want to make it 3 and I tried:

SQLSetEnvAttr(AfxGetHENV(),SQL_ATTR_ODBC_VERSION,(void*)SQL_OV_ODBC3,0);

It fails and I suppose it is because OpenEx already have an HDBC created. Does that mean I cannot use CDatabase and I have to write my own ODBC wrapper class? Thanks.

Kevin

You might be able to derive your own class from CDatabase and override AllocConnect adding the call to SQLSetEnvAttr.

MFC CDatabase and ODBC version

Hi all,

I created a CDatabase object, called OpenEx and checked the ODBC version with:

unsigned int version;

SQLGetEnvAttr(AfxGetHENV(),SQL_ATTR_ODBC_VERSION,&version,0,0);

and the version is 2. I want to make it 3 and I tried:

SQLSetEnvAttr(AfxGetHENV(),SQL_ATTR_ODBC_VERSION,(void*)SQL_OV_ODBC3,0);

It fails and I suppose it is because OpenEx already have an HDBC created. Does that mean I cannot use CDatabase and I have to write my own ODBC wrapper class? Thanks.

Kevin

You might be able to derive your own class from CDatabase and override AllocConnect adding the call to SQLSetEnvAttr.

Friday, March 9, 2012

Methods of #temp table creation.

Hello,
What is the difference between the two?
(a) Explicitly create a temp table using "create table #tableName...".
After it has been created, populate it using an explicit "insert into
#tableName".
Table creation and population of records take place in 2 t-sql statements.
(b) Let the #tableName get created on the fly when using a "select top 10
cid into #tableName from storesLink".
Table creation and population of records take place in a single t-sql
statement.
Both of them achieve the same result.
But, what is the difference in performance?
Are there any other points that I should keep in mind when adopting any of
the above two approaches ?
Cheers!
SQLCatzThe second one causes locking on some of the system tables and should
be avoided. Use the first one or better yet, use the table variable.
Aramid
On Wed, 6 Apr 2005 23:29:03 -0700, "SQLCatz"
<SQLCatz@.discussions.microsoft.com> wrote:
>Hello,
>What is the difference between the two?
>(a) Explicitly create a temp table using "create table #tableName...".
>After it has been created, populate it using an explicit "insert into
>#tableName".
>Table creation and population of records take place in 2 t-sql statements.
>(b) Let the #tableName get created on the fly when using a "select top 10
>cid into #tableName from storesLink".
>Table creation and population of records take place in a single t-sql
>statement.
>Both of them achieve the same result.
>But, what is the difference in performance?
>Are there any other points that I should keep in mind when adopting any of
>the above two approaches ?
>Cheers!
>SQLCatz
>|||they are about the same in performance if you don't have recompile. For
recompile info, see:
http://support.microsoft.com/default.aspx?scid=kb;en-us;q243586
--
--
Wei Xiao [MSFT]
SQL Server Storage Engine Development
http://blogs.msdn.com/weix
This posting is provided "AS IS" with no warranties, and confers no rights.
"SQLCatz" <SQLCatz@.discussions.microsoft.com> wrote in message
news:9FBD6D28-361B-460A-B47B-7CBD7DE86430@.microsoft.com...
> Hello,
> What is the difference between the two?
> (a) Explicitly create a temp table using "create table #tableName...".
> After it has been created, populate it using an explicit "insert into
> #tableName".
> Table creation and population of records take place in 2 t-sql statements.
> (b) Let the #tableName get created on the fly when using a "select top 10
> cid into #tableName from storesLink".
> Table creation and population of records take place in a single t-sql
> statement.
> Both of them achieve the same result.
> But, what is the difference in performance?
> Are there any other points that I should keep in mind when adopting any of
> the above two approaches ?
> Cheers!
> SQLCatz
>|||On Wed, 6 Apr 2005 23:29:03 -0700, SQLCatz wrote:
(snip)
>Are there any other points that I should keep in mind when adopting any of
>the above two approaches ?
Hi SQLCatz,
If you use CREATE TABLE, you can add constraints and indexes right away,
or you can chooose to add them after the INSERT. If you use SELECT INTO,
you can only add the constraints and indexes later.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)

Methods of #temp table creation.

Hello,
What is the difference between the two?
(a) Explicitly create a temp table using "create table #tableName...".
After it has been created, populate it using an explicit "insert into
#tableName".
Table creation and population of records take place in 2 t-sql statements.
(b) Let the #tableName get created on the fly when using a "select top 10
cid into #tableName from storesLink".
Table creation and population of records take place in a single t-sql
statement.
Both of them achieve the same result.
But, what is the difference in performance?
Are there any other points that I should keep in mind when adopting any of
the above two approaches ?
Cheers!
SQLCatz
The second one causes locking on some of the system tables and should
be avoided. Use the first one or better yet, use the table variable.
Aramid
On Wed, 6 Apr 2005 23:29:03 -0700, "SQLCatz"
<SQLCatz@.discussions.microsoft.com> wrote:

>Hello,
>What is the difference between the two?
>(a) Explicitly create a temp table using "create table #tableName...".
>After it has been created, populate it using an explicit "insert into
>#tableName".
>Table creation and population of records take place in 2 t-sql statements.
>(b) Let the #tableName get created on the fly when using a "select top 10
>cid into #tableName from storesLink".
>Table creation and population of records take place in a single t-sql
>statement.
>Both of them achieve the same result.
>But, what is the difference in performance?
>Are there any other points that I should keep in mind when adopting any of
>the above two approaches ?
>Cheers!
>SQLCatz
>
|||they are about the same in performance if you don't have recompile. For
recompile info, see:
http://support.microsoft.com/default...;en-us;q243586
--
Wei Xiao [MSFT]
SQL Server Storage Engine Development
http://blogs.msdn.com/weix
This posting is provided "AS IS" with no warranties, and confers no rights.
"SQLCatz" <SQLCatz@.discussions.microsoft.com> wrote in message
news:9FBD6D28-361B-460A-B47B-7CBD7DE86430@.microsoft.com...
> Hello,
> What is the difference between the two?
> (a) Explicitly create a temp table using "create table #tableName...".
> After it has been created, populate it using an explicit "insert into
> #tableName".
> Table creation and population of records take place in 2 t-sql statements.
> (b) Let the #tableName get created on the fly when using a "select top 10
> cid into #tableName from storesLink".
> Table creation and population of records take place in a single t-sql
> statement.
> Both of them achieve the same result.
> But, what is the difference in performance?
> Are there any other points that I should keep in mind when adopting any of
> the above two approaches ?
> Cheers!
> SQLCatz
>
|||On Wed, 6 Apr 2005 23:29:03 -0700, SQLCatz wrote:
(snip)
>Are there any other points that I should keep in mind when adopting any of
>the above two approaches ?
Hi SQLCatz,
If you use CREATE TABLE, you can add constraints and indexes right away,
or you can chooose to add them after the INSERT. If you use SELECT INTO,
you can only add the constraints and indexes later.
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)

Methods of #temp table creation.

Hello,
What is the difference between the two?
(a) Explicitly create a temp table using "create table #tableName...".
After it has been created, populate it using an explicit "insert into
#tableName".
Table creation and population of records take place in 2 t-sql statements.
(b) Let the #tableName get created on the fly when using a "select top 10
cid into #tableName from storesLink".
Table creation and population of records take place in a single t-sql
statement.
Both of them achieve the same result.
But, what is the difference in performance?
Are there any other points that I should keep in mind when adopting any of
the above two approaches ?
Cheers!
SQLCatzThe second one causes locking on some of the system tables and should
be avoided. Use the first one or better yet, use the table variable.
Aramid
On Wed, 6 Apr 2005 23:29:03 -0700, "SQLCatz"
<SQLCatz@.discussions.microsoft.com> wrote:

>Hello,
>What is the difference between the two?
>(a) Explicitly create a temp table using "create table #tableName...".
>After it has been created, populate it using an explicit "insert into
>#tableName".
>Table creation and population of records take place in 2 t-sql statements.
>(b) Let the #tableName get created on the fly when using a "select top 10
>cid into #tableName from storesLink".
>Table creation and population of records take place in a single t-sql
>statement.
>Both of them achieve the same result.
>But, what is the difference in performance?
>Are there any other points that I should keep in mind when adopting any of
>the above two approaches ?
>Cheers!
>SQLCatz
>|||they are about the same in performance if you don't have recompile. For
recompile info, see:
http://support.microsoft.com/defaul...b;en-us;q243586
--
Wei Xiao [MSFT]
SQL Server Storage Engine Development
http://blogs.msdn.com/weix
This posting is provided "AS IS" with no warranties, and confers no rights.
"SQLCatz" <SQLCatz@.discussions.microsoft.com> wrote in message
news:9FBD6D28-361B-460A-B47B-7CBD7DE86430@.microsoft.com...
> Hello,
> What is the difference between the two?
> (a) Explicitly create a temp table using "create table #tableName...".
> After it has been created, populate it using an explicit "insert into
> #tableName".
> Table creation and population of records take place in 2 t-sql statements.
> (b) Let the #tableName get created on the fly when using a "select top 10
> cid into #tableName from storesLink".
> Table creation and population of records take place in a single t-sql
> statement.
> Both of them achieve the same result.
> But, what is the difference in performance?
> Are there any other points that I should keep in mind when adopting any of
> the above two approaches ?
> Cheers!
> SQLCatz
>|||On Wed, 6 Apr 2005 23:29:03 -0700, SQLCatz wrote:
(snip)
>Are there any other points that I should keep in mind when adopting any of
>the above two approaches ?
Hi SQLCatz,
If you use CREATE TABLE, you can add constraints and indexes right away,
or you can chooose to add them after the INSERT. If you use SELECT INTO,
you can only add the constraints and indexes later.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)

method call works from .Net form and not from SQL CLR - EnterpriseLibrary used

Hello

I created a wrapper class for a function, and exposed it through CLR. However, if I call this function form SQL it blows up but if I call directly from a test Windows Form the call works fine.

The blow up is related to EnterpriseLibrary.Data, where my Queue class uses that library to do all data access call ops

Here's my wrapper class:

namespace inlineCLRsql{

public static class Wrapper{

public static void CallQueueEntry(int queueId, int deskNo, int missed){

inLineLib.Queue oQueue;

inLineLib.QueueEntry oQueueEntry;

oQueue = new inLineLib.Queue(queueId);

oQueueEntry = oQueue.callQueueEntry(deskNo, false);

Microsoft.SqlServer.Server.SqlContext.Pipe.Send(oQueueEntry.queueNum.ToString());

}

}

And this is my CLR SQL creation code:

CREATE PROC sp_CallQueueEntry

@.queueId int,

@.deskNo int,

@.missed int

AS

EXTERNAL NAME inLineLib.[inlineCLRsql.Wrapper].CallQueueEntry

GO

sp_CallQueueEntry 4,2,0

Here is what I get as a result

System.NullReferenceException: Object reference not set to an instance of an object.

System.NullReferenceException:

at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.get_DefaultName()

at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseMapper.MapName(String name, IConfigurationSource configSource)

at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfigurationNameMappingStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id)

at Microsoft.Practices.ObjectBuilder.BuilderBase`1.DoBuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies)

at Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies)

at Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp[TTypeToBuild](IReadWriteLocator locator, String idToBuild, Object existing, PolicyList[] transientPolicies)

at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp[T](IReadWriteLocator locator, IConfigurationSource configurationSource)

at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp[T](IConfigurationSource configurationSource)

at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.NameTypeFactoryBase`1.CreateDefault()

at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.CreateDatabase()

at inLineLib.Queue.getNextQueueEntry(Int32 servedBy)

at inLineLib.Queue.callQueueEntry(Int32 servedBy, Boolean callMissed)

at inlineCLRsql.Wrapper.CallQueueEntry(Int32 queueId, Int32 deskNo, Int32 missed)

What can I do to fix this?

Cheers

M

This is almost a total guess - I've never used EntLib. However, I found some one else hit this issue when EntLib was not able to find the database in the application config file: http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_21833370.html

This is likely to be the same problem you're facing. I believe you can solve this by running the Enterprise Library Config tool and specify your config file as sqlservr.exe.config in the same directory as sqlservr.exe. Or you can try copying and renaming the config file your Windows Form app is using.

Hope this works.

Steven

Wednesday, March 7, 2012

Metadata Issues

I am experiencing something really bazaar. The package I created usign SQL2K5 Sept. CTP Builds and functions just fine in one domain. When I deployed to another machine & new domain, we get Metadata errors within dataflow that was modified. We had encountered this earlier but by rebuilding the package it has solved the problem. This time, rebuild is not helping. How can metadata for data flow of a package get corrupted from one environment to another. Also, what's the purpose of building a package when the package is in XML (Text). I don't see any binary code for script tasks.

What exactly is the message? My favourite at present when moving between environments is the encyrption error for passwords (or any sensitive propertry), since the default protection uses the user key, so obviously changing domains changes accounts and therefore the decyption fails. Setting don't save sensitive information and use configurations to apply passwords again helps somewhat.|||Thanks for your reply Darren. I have already cross the hurdle of Package Protection level issue. Current settings are "Don't save sensitive" info. I am curious to see if they modify this default setting in RTM rel.
|||Using the RTM release now available to MSDN subscribers, the default is User Key still.|||Great!!. By the way, what does a Build functionality do for a package when script tasks within either control flow or data flow are set not to compile on save. If I don't build the package, it still works so why build it?
|||

Scripts can be compiled or not. If compiled then they run faster since there is no compilation overhead each time the package is run. I wasn't aware that this was linked to the package build, I assumed it happened within the script editor itself and VSA. Only downside of pre-compiled scripts is they are processor specific, so x86 to x64 deployments for example will fail.

|||You'd be better of ignoring me and just reading Books Online. The package Save induces the compilation.

From ScriptTask.PreCompile

Property Value

true if the VSA script is compiled when the package is saved; otherwise, false. The default value is true.

Remarks

VSA scripts must be compiled before the package runs. The Script task includes the option to pre-compile script into binary code when the package is saved. When script is precompiled, the language engine is not loaded at run time and the package runs more quickly; however, compiled binary files consume significant disk space. Script that is not precompiled is compiled at run time, which slows package execution but consumes less disk space. When storing large packages is not a problem, you should pre-compile your VSA scripts.

|||

DarrenSQLIS wrote:

Only downside of pre-compiled scripts is they are processor specific, so x86 to x64 deployments for example will fail.


Not really. The script is precompiled to MSIL (.NET intemediary language) which is platform-independent. It will be JIT-ed to process-specific code at runtime.

Saturday, February 25, 2012

Message: Missing end comment mark '*/'.

Hi,

I created a web syncronization merge replication ,both servers and clients are sql server 2005 and everything is fine with the settings , but while synchronization and after i received some sch files i got the following message at the subscribers on the initial snapshot operation:

2006-06-27 07:50:14.471 The schema script 'myfile_311.sch' could not be propagated to the subscriber.
2006-06-27 07:50:14.471 Category:NULL
Source: Merge Replication Provider
Number: -2147201001
Message: The schema script 'myfile_311.sch' could not be propagated to the subscriber.
2006-06-27 07:50:14.471 Category:NULL
Source: Microsoft SQL Native Client
Number: 113
Message: Missing end comment mark '*/'.

Any idea ?


Tarek Ghazali

SQL Server MVP

My guess is that myfile_311.sch contains a stored procedure|view|function with something like

/*

...

go

*/

There is a longstanding limitation in our batch parsing logic that will erroroneously recognize 'go's embedded in comments to be batch delimiters. The only workaround for this is to edit the script generated by the snapshot agent to remove the offending comment. We really hope that we can address this issue in the near future.

-Raymond

message with xml validation

Hi

I created a XML SCHEMA and MESSAGE TYPE with VALIDATION = VALID_XML WITH SCHEMA COLLECTION.

I thought this would validate the message send with the schema. but when I try to send the message with a different xml, the message is send. there were no errors. Is there something I did not set?

thanks

P

Does the target database (if different from the initiator database) define the message type with the same schema?

|||its the same, but it should not been able to send if the xml is not according to the valid schema?|||Can you post your CREATE MESSAGE TYPE, CREATE CONTRACT, CREATE (target) SERVICE, BEGIN DIALOG and SEND statements?