Showing posts with label object. Show all posts
Showing posts with label object. Show all posts

Friday, March 30, 2012

Managed replacement for SQLDMO?

In VS 2003 I used SQLDMO (Com Object) to list all available SQL Servers. Is in SQL Server 2005 a managed .net Component that can do that task?

Thanks,
Rainer.

In SQL Server 2005 SMO(Sql management object) replaces DMO(data management object). I don't use DMO because DMO uses the system tables in the Master database which is Microsoft property. Microsoft make changes with service packs that can affect DMO based code. Try the link below for Microsoft provided tutorial on SMO. Hope this helps.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/sql_ovyukondev.asp

|||Thanks. Smo was the magic word ;). I found here a good article that solves my problem:http://www.yukonxml.com/articles/smo/

Rainer.

Manage server messages shows % instead of name of item in error

When I right click on my sql server in the enterprise manager and select all
tasks --> manage server messages I am not seeing the object the error is
referring to. Instead I see a % wherever it should be inserting the object
name like below.
Incorrect value for parameter '%s'.
What do i have to do to get the server to substitute the tablename, etc. for
the % sign. Also is there anyway to see a timestamp for the errors returned.
It would be helpful to know when the error occured. Basically I am having
issues with an ASP.net page that is doing an update on a particular table. It
is not throwing an exception on the asp.net side so i wanted to look on the
sql side to see what happened. But on the sql side i can't tell because there
is no indication which table or when a particualr message in the manage
server messages tool refers too. Is there a better way to go about this?
Server is SQL server 2000.What you are seeing in Enterprise Manager is a collection of all the error
messages, that are stored in the master..sysmessages table. They are not the
errors raised by your application. When an error occurs, SQL Server will
raise those errors by substituting the parameters with appropriate values.
If you think you are experiencing an error in your application, then you
should capture the error number and the error description via the mechanism
provided by your programming language. For example, the Err object in VB.
Alternatively you can use SQL Server Profiler to see what statements are
being executed by SQL Server. You can trace the Exception event to capture
errors.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Kevin McPhail" <KevinMcPhail@.discussions.microsoft.com> wrote in message
news:2F80D3C9-FC22-4431-9F8A-EBB2FA7EF0B0@.microsoft.com...
When I right click on my sql server in the enterprise manager and select all
tasks --> manage server messages I am not seeing the object the error is
referring to. Instead I see a % wherever it should be inserting the object
name like below.
Incorrect value for parameter '%s'.
What do i have to do to get the server to substitute the tablename, etc. for
the % sign. Also is there anyway to see a timestamp for the errors returned.
It would be helpful to know when the error occured. Basically I am having
issues with an ASP.net page that is doing an update on a particular table.
It
is not throwing an exception on the asp.net side so i wanted to look on the
sql side to see what happened. But on the sql side i can't tell because
there
is no indication which table or when a particualr message in the manage
server messages tool refers too. Is there a better way to go about this?
Server is SQL server 2000.|||Narayana:
Thanks for your suggestions. Can you point me to a resource on tracing the
message with profiler. The vb app does not seem to be throwing an exception
so i am trying to figure out what is going on. I am not sure it is even
trying to write to the db at this point.
"Narayana Vyas Kondreddi" wrote:
> What you are seeing in Enterprise Manager is a collection of all the error
> messages, that are stored in the master..sysmessages table. They are not the
> errors raised by your application. When an error occurs, SQL Server will
> raise those errors by substituting the parameters with appropriate values.
> If you think you are experiencing an error in your application, then you
> should capture the error number and the error description via the mechanism
> provided by your programming language. For example, the Err object in VB.
> Alternatively you can use SQL Server Profiler to see what statements are
> being executed by SQL Server. You can trace the Exception event to capture
> errors.
> --
> HTH,
> Vyas, MVP (SQL Server)
> SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
>
> "Kevin McPhail" <KevinMcPhail@.discussions.microsoft.com> wrote in message
> news:2F80D3C9-FC22-4431-9F8A-EBB2FA7EF0B0@.microsoft.com...
> When I right click on my sql server in the enterprise manager and select all
> tasks --> manage server messages I am not seeing the object the error is
> referring to. Instead I see a % wherever it should be inserting the object
> name like below.
> Incorrect value for parameter '%s'.
> What do i have to do to get the server to substitute the tablename, etc. for
> the % sign. Also is there anyway to see a timestamp for the errors returned.
> It would be helpful to know when the error occured. Basically I am having
> issues with an ASP.net page that is doing an update on a particular table.
> It
> is not throwing an exception on the asp.net side so i wanted to look on the
> sql side to see what happened. But on the sql side i can't tell because
> there
> is no indication which table or when a particualr message in the manage
> server messages tool refers too. Is there a better way to go about this?
> Server is SQL server 2000.
>
>|||Could it be that you have something like 'On Error Resume Next' in your VB
app, that is silently ignoring the error?
I am not aware of any step by step instructions for using Profiler but, it
should be quite simple and intuitive once you open it. I have some related
articles at: http://vyaskn.tripod.com/analyzing_profiler_output.htm
Apart from that do checkout SQL Server Books Online.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Kevin McPhail" <KevinMcPhail@.discussions.microsoft.com> wrote in message
news:A60CD0CE-FB4B-4CB3-B74D-0226A913D920@.microsoft.com...
Narayana:
Thanks for your suggestions. Can you point me to a resource on tracing the
message with profiler. The vb app does not seem to be throwing an exception
so i am trying to figure out what is going on. I am not sure it is even
trying to write to the db at this point.
"Narayana Vyas Kondreddi" wrote:
> What you are seeing in Enterprise Manager is a collection of all the error
> messages, that are stored in the master..sysmessages table. They are not
the
> errors raised by your application. When an error occurs, SQL Server will
> raise those errors by substituting the parameters with appropriate values.
> If you think you are experiencing an error in your application, then you
> should capture the error number and the error description via the
mechanism
> provided by your programming language. For example, the Err object in VB.
> Alternatively you can use SQL Server Profiler to see what statements are
> being executed by SQL Server. You can trace the Exception event to capture
> errors.
> --
> HTH,
> Vyas, MVP (SQL Server)
> SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
>
> "Kevin McPhail" <KevinMcPhail@.discussions.microsoft.com> wrote in message
> news:2F80D3C9-FC22-4431-9F8A-EBB2FA7EF0B0@.microsoft.com...
> When I right click on my sql server in the enterprise manager and select
all
> tasks --> manage server messages I am not seeing the object the error is
> referring to. Instead I see a % wherever it should be inserting the
object
> name like below.
> Incorrect value for parameter '%s'.
> What do i have to do to get the server to substitute the tablename, etc.
for
> the % sign. Also is there anyway to see a timestamp for the errors
returned.
> It would be helpful to know when the error occured. Basically I am having
> issues with an ASP.net page that is doing an update on a particular table.
> It
> is not throwing an exception on the asp.net side so i wanted to look on
the
> sql side to see what happened. But on the sql side i can't tell because
> there
> is no indication which table or when a particualr message in the manage
> server messages tool refers too. Is there a better way to go about this?
> Server is SQL server 2000.
>
>|||Narayana:
Thanks, I had already opened the profiler and you are right it is pretty
intuitive. I was able to capture the sql statement being sent from the vb app
and it did not cause an exception it just was returning 0 rows affected.
Maybe you guys could take a quick look at the statement 9hah - it is ugly)
and see if you can see the error. It is generated by ASP.Net 2.0 using a
gridview and sqldatasource. All of the code is generated by the asp controls
not me so I was expecting it to work for the simple test i was doing. here is
the generated statement with linebreaks inserted to make it more readable.
exec sp_executesql N
'UPDATE [MSDS]
SET
[MSDSName] = @.MSDSName,
[MSDSLink] = @.MSDSLink,
[MSDSSubmittedBy] = @.MSDSSubmittedBy,
[MSDSApprovedBy] = @.MSDSApprovedBy,
[ProductCategoryID] = @.ProductCategoryID,
[MSDSLanguageID] = @.MSDSLanguageID,
[MSDSApproved] = @.MSDSApproved,
[MSDSSubmittedDate] = @.MSDSSubmittedDate,
[MSDSExpired] = @.MSDSExpired
WHERE [MSDSID] = @.original_MSDSID
AND [MSDSName] = @.original_MSDSName
AND [MSDSLink] = @.original_MSDSLink
AND [MSDSSubmittedBy] = @.original_MSDSSubmittedBy
AND [MSDSApprovedBy] = @.original_MSDSApprovedBy
AND [ProductCategoryID] = @.original_ProductCategoryID
AND [MSDSLanguageID] = @.original_MSDSLanguageID
AND [MSDSApproved] = @.original_MSDSApproved
AND [MSDSSubmittedDate] = @.original_MSDSSubmittedDate
AND [MSDSExpired] = @.original_MSDSExpired',
N'@.MSDSName nvarchar(4000),
@.MSDSLink nvarchar(4000),
@.MSDSSubmittedBy nvarchar(8),
@.MSDSApprovedBy nvarchar(4000),
@.ProductCategoryID int,
@.MSDSLanguageID int,
@.MSDSApproved bit,
@.MSDSSubmittedDate nvarchar(4000),
@.MSDSExpired bit,@.original_MSDSID int,
@.original_MSDSName nvarchar(4000),
@.original_MSDSLink nvarchar(4000),
@.original_MSDSSubmittedBy nvarchar(8),
@.original_MSDSApprovedBy nvarchar(4000),
@.original_ProductCategoryID int,
@.original_MSDSLanguageID int,
@.original_MSDSApproved bit,
@.original_MSDSSubmittedDate nvarchar(4000),
@.original_MSDSExpired bit',
@.MSDSName = NULL,
@.MSDSLink = NULL,
@.MSDSSubmittedBy = N'KMcPhail',
@.MSDSApprovedBy = NULL,
@.ProductCategoryID = 5,
@.MSDSLanguageID = 1,
@.MSDSApproved = 0,
@.MSDSSubmittedDate = NULL,
@.MSDSExpired = 0,
@.original_MSDSID = 133,
@.original_MSDSName = NULL,
@.original_MSDSLink = NULL,
@.original_MSDSSubmittedBy = N'KMcPhail',
@.original_MSDSApprovedBy = NULL,
@.original_ProductCategoryID = 5,
@.original_MSDSLanguageID = 3,
@.original_MSDSApproved = 0,
@.original_MSDSSubmittedDate = NULL,
@.original_MSDSExpired = 0
"Narayana Vyas Kondreddi" wrote:
> Could it be that you have something like 'On Error Resume Next' in your VB
> app, that is silently ignoring the error?
> I am not aware of any step by step instructions for using Profiler but, it
> should be quite simple and intuitive once you open it. I have some related
> articles at: http://vyaskn.tripod.com/analyzing_profiler_output.htm
> Apart from that do checkout SQL Server Books Online.
> --
> HTH,
> Vyas, MVP (SQL Server)
> SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
>
> "Kevin McPhail" <KevinMcPhail@.discussions.microsoft.com> wrote in message
> news:A60CD0CE-FB4B-4CB3-B74D-0226A913D920@.microsoft.com...
> Narayana:
> Thanks for your suggestions. Can you point me to a resource on tracing the
> message with profiler. The vb app does not seem to be throwing an exception
> so i am trying to figure out what is going on. I am not sure it is even
> trying to write to the db at this point.
> "Narayana Vyas Kondreddi" wrote:
> > What you are seeing in Enterprise Manager is a collection of all the error
> > messages, that are stored in the master..sysmessages table. They are not
> the
> > errors raised by your application. When an error occurs, SQL Server will
> > raise those errors by substituting the parameters with appropriate values.
> >
> > If you think you are experiencing an error in your application, then you
> > should capture the error number and the error description via the
> mechanism
> > provided by your programming language. For example, the Err object in VB.
> >
> > Alternatively you can use SQL Server Profiler to see what statements are
> > being executed by SQL Server. You can trace the Exception event to capture
> > errors.
> > --
> > HTH,
> > Vyas, MVP (SQL Server)
> > SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
> >
> >
> > "Kevin McPhail" <KevinMcPhail@.discussions.microsoft.com> wrote in message
> > news:2F80D3C9-FC22-4431-9F8A-EBB2FA7EF0B0@.microsoft.com...
> > When I right click on my sql server in the enterprise manager and select
> all
> > tasks --> manage server messages I am not seeing the object the error is
> > referring to. Instead I see a % wherever it should be inserting the
> object
> > name like below.
> >
> > Incorrect value for parameter '%s'.
> >
> > What do i have to do to get the server to substitute the tablename, etc.
> for
> > the % sign. Also is there anyway to see a timestamp for the errors
> returned.
> > It would be helpful to know when the error occured. Basically I am having
> > issues with an ASP.net page that is doing an update on a particular table.
> > It
> > is not throwing an exception on the asp.net side so i wanted to look on
> the
> > sql side to see what happened. But on the sql side i can't tell because
> > there
> > is no indication which table or when a particualr message in the manage
> > server messages tool refers too. Is there a better way to go about this?
> > Server is SQL server 2000.
> >
> >
> >
>
>

Manage server messages shows % instead of name of item in error

When I right click on my sql server in the enterprise manager and select all
tasks --> manage server messages I am not seeing the object the error is
referring to. Instead I see a % wherever it should be inserting the object
name like below.
Incorrect value for parameter '%s'.
What do i have to do to get the server to substitute the tablename, etc. for
the % sign. Also is there anyway to see a timestamp for the errors returned.
It would be helpful to know when the error occured. Basically I am having
issues with an ASP.net page that is doing an update on a particular table. I
t
is not throwing an exception on the asp.net side so i wanted to look on the
sql side to see what happened. But on the sql side i can't tell because ther
e
is no indication which table or when a particualr message in the manage
server messages tool refers too. Is there a better way to go about this?
Server is SQL server 2000.What you are seeing in Enterprise Manager is a collection of all the error
messages, that are stored in the master..sysmessages table. They are not the
errors raised by your application. When an error occurs, SQL Server will
raise those errors by substituting the parameters with appropriate values.
If you think you are experiencing an error in your application, then you
should capture the error number and the error description via the mechanism
provided by your programming language. For example, the Err object in VB.
Alternatively you can use SQL Server Profiler to see what statements are
being executed by SQL Server. You can trace the Exception event to capture
errors.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Kevin McPhail" <KevinMcPhail@.discussions.microsoft.com> wrote in message
news:2F80D3C9-FC22-4431-9F8A-EBB2FA7EF0B0@.microsoft.com...
When I right click on my sql server in the enterprise manager and select all
tasks --> manage server messages I am not seeing the object the error is
referring to. Instead I see a % wherever it should be inserting the object
name like below.
Incorrect value for parameter '%s'.
What do i have to do to get the server to substitute the tablename, etc. for
the % sign. Also is there anyway to see a timestamp for the errors returned.
It would be helpful to know when the error occured. Basically I am having
issues with an ASP.net page that is doing an update on a particular table.
It
is not throwing an exception on the asp.net side so i wanted to look on the
sql side to see what happened. But on the sql side i can't tell because
there
is no indication which table or when a particualr message in the manage
server messages tool refers too. Is there a better way to go about this?
Server is SQL server 2000.

Manage server messages shows % instead of name of item in error

When I right click on my sql server in the enterprise manager and select all
tasks --> manage server messages I am not seeing the object the error is
referring to. Instead I see a % wherever it should be inserting the object
name like below.
Incorrect value for parameter '%s'.
What do i have to do to get the server to substitute the tablename, etc. for
the % sign. Also is there anyway to see a timestamp for the errors returned.
It would be helpful to know when the error occured. Basically I am having
issues with an ASP.net page that is doing an update on a particular table. It
is not throwing an exception on the asp.net side so i wanted to look on the
sql side to see what happened. But on the sql side i can't tell because there
is no indication which table or when a particualr message in the manage
server messages tool refers too. Is there a better way to go about this?
Server is SQL server 2000.
What you are seeing in Enterprise Manager is a collection of all the error
messages, that are stored in the master..sysmessages table. They are not the
errors raised by your application. When an error occurs, SQL Server will
raise those errors by substituting the parameters with appropriate values.
If you think you are experiencing an error in your application, then you
should capture the error number and the error description via the mechanism
provided by your programming language. For example, the Err object in VB.
Alternatively you can use SQL Server Profiler to see what statements are
being executed by SQL Server. You can trace the Exception event to capture
errors.
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Kevin McPhail" <KevinMcPhail@.discussions.microsoft.com> wrote in message
news:2F80D3C9-FC22-4431-9F8A-EBB2FA7EF0B0@.microsoft.com...
When I right click on my sql server in the enterprise manager and select all
tasks --> manage server messages I am not seeing the object the error is
referring to. Instead I see a % wherever it should be inserting the object
name like below.
Incorrect value for parameter '%s'.
What do i have to do to get the server to substitute the tablename, etc. for
the % sign. Also is there anyway to see a timestamp for the errors returned.
It would be helpful to know when the error occured. Basically I am having
issues with an ASP.net page that is doing an update on a particular table.
It
is not throwing an exception on the asp.net side so i wanted to look on the
sql side to see what happened. But on the sql side i can't tell because
there
is no indication which table or when a particualr message in the manage
server messages tool refers too. Is there a better way to go about this?
Server is SQL server 2000.

Wednesday, March 28, 2012

Manage changes in SQL object.

1. How do I manage changes in SQL Server objects? Not schema.

SQL Server does not have built-in version control. so can we manage or not.

Use an external source control provider to store the sql server object scripts in.|||

Help me understand what you mean by

SQL Server objects? Not schema

SQL Server objects ARE schema...

|||

Hi Arnie,

I have many databse.

Schema means- like procedure or function etc.

I want to use data in VSS not schema.

|||

VSS is typically NOT for data. VSS is source control for schema objects, i.e., table definitions, view definitions, stored procedure and function code, etc. In other words, source control for the schema objects source code.

If you want a tool to manage data, then perhaps you should examine some of the third party products that will be able to compare databases and provide you reports and scripts about the differences in data.

Comparison Tools
Object Comparison:
AdeptSQL Diff
AlfaAlfa Software - SQL Server Comparison Tool
ApexSQL – SQL Diff
Best SoftTool – SQL DBCompare
e-Dule - DB SynchroComp
PrimeLogics - DataVision 2007
Quest – SchemaCompare
RAC4SQL's QALite (Free)
Red Gate – SQL Compare
SQL Effects Clarity
TASC - SQL Delta
Teratrax Database Compare
TulsaSoft - SQL Examiner
Voltex Data Systems - SQLDBcontrol
XpressApps - sqlXpress Diff
xSQL Software - xSQL Object
Data Comparison
ApexSQL – SQL Diff
Best SoftTool – SQL DBCompare
Quest - DataCompare
Red Gate – Data Compare
TASC - SQL Delta
TulsaSoft - SQL Data Examiner
xSQL Software - xSQL DataCompare
DTS Comparison
Red Gate – DTS Package Compare
Server Comparison
Quest - ServerCompare
Free Tools
RAC4SQL's QALite (Free)
SQL Effects Clarity CE Edition