Showing posts with label call. Show all posts
Showing posts with label call. Show all posts

Wednesday, March 28, 2012

How can I compare two databases?

I have two databases - I will call them database A and database B.

I want to run some code on database A, and then check if database A became identical to database B.

How can I compare two databases? I want to compare them in terms of structure, not content.

Any suggestions? Thank you!there r couple of tools avialable in the market.
Check Red Gate Tools|||Does anybody know such a product that is free...I find a couple of products but they have only 14 days free trial period. I need such a tool for longer time...|||Does anybody know such a product that is free...I find a couple of products but they have only 14 days free trial period. I need such a tool for longer time...

Longer time? much better to make a program for that in that case. VB or something.|||If the databases are on the same server, then compare the sysobjects, syscolumns, and other system tables between the two using a full outer join on the natural keys, and listing any exceptions or discrepancies.|||Here's the poor mans way...

Generate a db script in EM for both databases. Then compare both text files.

Monday, March 26, 2012

How Can I call SQL Server SMO Objects in VC6 or VB6

How Can I call SQL Server SMO Objects in VC6 or VB6

Hi

I want to use SQL SMO (SQL Management Object .Net Library) in VC 6.0 and VB.6.0

I don’t want to use SQL DMO (COM component)

I tried to make COM callable wrapper (CCW) for SMO using the following command line execution.

RegAsm.exe /tlb:MicrosoftSqlServerSmoTest.tlb Microsoft.SqlServer.Smo.dll

After executing the command line RegAsm.exe, I got the following output.

Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.42

Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.

Types registered successfully

Type library exporter warning processing 'Microsoft.SqlServer.Management.Smo.Bac

kupDeviceList, Microsoft.SqlServer.Smo'. Warning: Type library exporter encounte

red a type that derives from a generic class and is not marked as [ClassInterfac

e(ClassInterfaceType.None)]. Class interfaces cannot be exposed for such types.

Consider marking the type with [ClassInterface(ClassInterfaceType.None)] and exp

osing an explicit interface as the default interface to COM using the ComDefault

Interface attribute.

Assembly exported to 'C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Mi

crosoftSqlServerSmoTest.tlb', and the type library was registered successfully

In My VB6 Application I have included the Refrence Microsoft_SqlServer_Smo

Then I tried to call Server Object with parameter shown below.

Dim objServer As Server

Set objServer = new Server(Server_Name)

But compile error occurs in the line Set objServer = new Server(Server_Name)


I have the following queries.

  1. How can I access SMO objects in VC 6 or VB6 applications using any method?

  1. How can I solve the compile error?

  1. How can I avoid the Warning when calling the callable wrapper (CCW)?

4. Is it possible to use parameterized constructors in .net components?

  1. Is it necessary that the GUIDs to all .NET objects so that the appropriate COM required registry entries can be created?

For example :

[Guid("2979DBB0-3371-4841-9B94-B79EAE28B503")]

public class TestInteropSample

{

}

Kindly reply me ,

Thanking you,

Kuttappan.

Hello,

I'm having the same problem. Did you ever find a solution?

thanks,

kelly

|||

SMO is only supported in VB/C#.Net 2005. It requires the .Net 2.0 Framework, which isn't available in VB/VC 6.

Friday, March 23, 2012

How Can I call SQL Server SMO Objects in VC6 or VB6

How Can I call SQL Server SMO Objects in VC6 or VB6

Hi

I want to use SQL SMO (SQL Management Object .Net Library) in VC 6.0 and VB.6.0

I don’t want to use SQL DMO (COM component)

I tried to make COM callable wrapper (CCW) for SMO using the following command line execution.

RegAsm.exe /tlb:MicrosoftSqlServerSmoTest.tlb Microsoft.SqlServer.Smo.dll

After executing the command line RegAsm.exe, I got the following output.

Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.42

Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.

Types registered successfully

Type library exporter warning processing 'Microsoft.SqlServer.Management.Smo.Bac

kupDeviceList, Microsoft.SqlServer.Smo'. Warning: Type library exporter encounte

red a type that derives from a generic class and is not marked as [ClassInterfac

e(ClassInterfaceType.None)]. Class interfaces cannot be exposed for such types.

Consider marking the type with [ClassInterface(ClassInterfaceType.None)] and exp

osing an explicit interface as the default interface to COM using the ComDefault

Interface attribute.

Assembly exported to 'C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Mi

crosoftSqlServerSmoTest.tlb', and the type library was registered successfully

In My VB6 Application I have included the Refrence Microsoft_SqlServer_Smo

Then I tried to call Server Object with parameter shown below.

Dim objServer As Server

Set objServer = new Server(Server_Name)

But compile error occurs in the line Set objServer = new Server(Server_Name)


I have the following queries.

  1. How can I access SMO objects in VC 6 or VB6 applications using any method?

  1. How can I solve the compile error?

  1. How can I avoid the Warning when calling the callable wrapper (CCW)?

4. Is it possible to use parameterized constructors in .net components?

  1. Is it necessary that the GUIDs to all .NET objects so that the appropriate COM required registry entries can be created?

For example :

[Guid("2979DBB0-3371-4841-9B94-B79EAE28B503")]

public class TestInteropSample

{

}

Kindly reply me ,

Thanking you,

Kuttappan.

Hello,

I'm having the same problem. Did you ever find a solution?

thanks,

kelly

|||

SMO is only supported in VB/C#.Net 2005. It requires the .Net 2.0 Framework, which isn't available in VB/VC 6.

How Can I call SQL Server SMO Objects in VC6 or VB6

How Can I call SQL Server SMO Objects in VC6 or VB6

Hi

I want to use SQL SMO (SQL Management Object .Net Library) in VC 6.0 and VB.6.0

I don’t want to use SQL DMO (COM component)

I tried to make COM callable wrapper (CCW) for SMO using the following command line execution.

RegAsm.exe /tlb:MicrosoftSqlServerSmoTest.tlb Microsoft.SqlServer.Smo.dll

After executing the command line RegAsm.exe, I got the following output.

Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.42

Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.

Types registered successfully

Type library exporter warning processing 'Microsoft.SqlServer.Management.Smo.Bac

kupDeviceList, Microsoft.SqlServer.Smo'. Warning: Type library exporter encounte

red a type that derives from a generic class and is not marked as [ClassInterfac

e(ClassInterfaceType.None)]. Class interfaces cannot be exposed for such types.

Consider marking the type with [ClassInterface(ClassInterfaceType.None)] and exp

osing an explicit interface as the default interface to COM using the ComDefault

Interface attribute.

Assembly exported to 'C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Mi

crosoftSqlServerSmoTest.tlb', and the type library was registered successfully

In My VB6 Application I have included the Refrence Microsoft_SqlServer_Smo

Then I tried to call Server Object with parameter shown below.

Dim objServer As Server

Set objServer = new Server(Server_Name)

But compile error occurs in the line Set objServer = new Server(Server_Name)


I have the following queries.

  1. How can I access SMO objects in VC 6 or VB6 applications using any method?

  1. How can I solve the compile error?

  1. How can I avoid the Warning when calling the callable wrapper (CCW)?

4. Is it possible to use parameterized constructors in .net components?

  1. Is it necessary that the GUIDs to all .NET objects so that the appropriate COM required registry entries can be created?

For example :

[Guid("2979DBB0-3371-4841-9B94-B79EAE28B503")]

public class TestInteropSample

{

}

Kindly reply me ,

Thanking you,

Kuttappan.

Hello,

I'm having the same problem. Did you ever find a solution?

thanks,

kelly

|||

SMO is only supported in VB/C#.Net 2005. It requires the .Net 2.0 Framework, which isn't available in VB/VC 6.

How can I call a VB function from SQL Server SP?

Hi
I need to use the VB function "strconv" in my SP.
Is it possible?
Can anyone help?
Best regards
David LauWhy? What's so special about that particular string that converting it can't
be done in T-SQL, yet you decided it should be done on the server?
The sp_OA* procedures let you invoke ActiveX components from SQL, but there
are several downsides to this. The two worst IMHO are: possible negative
impact on server stability, and performance issues.
ML
http://milambda.blogspot.com/|||David L. wrote:

> Hi
> I need to use the VB function "strconv" in my SP.
> Is it possible?
> Can anyone help?
> Best regards
> David Lau
AFAIK all the features of strconv are supported by native TSQL
equivalents. It would therefore be simpler and much more efficient to
use the TSQL version rather than make an external call to VB. Take a
look at the string functions in SQL Server Books Online.
The answer to the question in your subject depends on the version of
SQL Server you are using. In SQL 2000 your options are limited to COM
automation using the sp_OA procs or making a call via an extended proc.
Usually it would be better to utilize client-side code or TSQL.
In 2005 you have the option of putting .NET code directly in a proc.
David Portas
SQL Server MVP
--|||don't do that
"David L." <DavidL@.discussions.microsoft.com> wrote in message
news:A3447E24-AD32-42D0-A834-9C8977D5596C@.microsoft.com...
> Hi
> I need to use the VB function "strconv" in my SP.
> Is it possible?
> Can anyone help?
> Best regards
> David Lau|||Hello David L.,

> I need to use the VB function "strconv" in my SP.
If you're just doing UpperCase/LowerCase, there's the Upper() and Lower()
functions in T-SQL. If your wanting ProperCase and you're using SQL2005,
you can wrap the function with SQLCLR, ala:
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Imports Microsoft.SqlServer.Server
Partial Public Class StringConversionFunctions
<Microsoft.SqlServer.Server.SqlFunction()> _
Public Shared Function ProperCase(ByVal Source As SqlString) As SqlString
Return New SqlString(StrConv(Source.Value, VbStrConv.ProperCase))
End Function
End Class
Call it via:
select 'Proper',dbo.ProperCase('ThE QUick BROWN fox jumpEd oVeR thE laZY
DOG')
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/|||Thank you Kent and everyone who has replied this email.
Let's say I would like to do the Narrow for Japanese charactors.
Is there any similar function in TSQL?
Best regards
David
"Kent Tegels" wrote:

> Hello David L.,
>
> If you're just doing UpperCase/LowerCase, there's the Upper() and Lower()
> functions in T-SQL. If your wanting ProperCase and you're using SQL2005,
> you can wrap the function with SQLCLR, ala:
> Imports System
> Imports System.Data
> Imports System.Data.SqlClient
> Imports System.Data.SqlTypes
> Imports Microsoft.SqlServer.Server
> Partial Public Class StringConversionFunctions
> <Microsoft.SqlServer.Server.SqlFunction()> _
> Public Shared Function ProperCase(ByVal Source As SqlString) As SqlStr
ing
> Return New SqlString(StrConv(Source.Value, VbStrConv.ProperCase))
> End Function
> End Class
> Call it via:
> select 'Proper',dbo.ProperCase('ThE QUick BROWN fox jumpEd oVeR thE laZY
> DOG')
>
> Thank you,
> Kent Tegels
> DevelopMentor
> http://staff.develop.com/ktegels/
>
>|||Hello David L.,

> Thank you Kent and everyone who has replied this email.
> Let's say I would like to do the Narrow for Japanese charactors.
> Is there any similar function in TSQL?
Not that I'm immediately aware since it's not really clear to me what Narrow
actually does. Is it something like this?
declare @.m1 nvarchar(50)
set @.m1 = N'? 150 ?'
select cast(@.m1 as varchar(50))
Either way, you should still be able to use the code previously shown with
a different enumeration value.
Domo,
Kentsql

Monday, March 12, 2012

how call stored procedure when user click on report line?

have a way to add ability to report, to do somthing, like delete
record, by calling Stored procedure when user click on some line within
the report?Hey I feel reports should be meant for reporting/Viewing. You should not
provide something like delete or modify options from reports. Then it becomes
an entry screen. I hope you will agree on this point.
Amarnath
"mtczx232@.yahoo.com" wrote:
> have a way to add ability to report, to do somthing, like delete
> record, by calling Stored procedure when user click on some line within
> the report?
>|||mtczx232@.yahoo.com wrote:
> have a way to add ability to report, to do somthing, like delete
> record, by calling Stored procedure when user click on some line within
> the report?
RS can call a stored procedure, or any arbitrary SQL with a side-effect
such as deleting a record.
Your SQL should return a result set as well as deleting the record. You
could navigate to another report, passing a parameter containing the id
of the parameter to delete. This "deleting" report would display
instead of the main report, which could look a bit funny.
Alternatively you could navigate to a URL of an ASP or ASPX page that
does the job. Ideally you would set the target so the web page
displayed as a pop-up with a message like "record xx deleted" instead
of replacing the whole report.