Showing posts with label programmatic. Show all posts
Showing posts with label programmatic. Show all posts

Wednesday, March 7, 2012

Programmatic way to replace partition DSV Table bindings with Query Bindings

I'm trying to programmatically replace all my partitions' DSV table bindings with query bindings.

In the partitions manager, when creating a new partition that's restricted via a query binding, the wizard manages to pull a default query from the DSV definition. Is there a way to do this programmatically? The closest thing I could find in the object model is the "Schema" property, but this isn't what I need.

I am pretty sure anything you can do in XMLA is possible to do through AMO.

The easiest way for you to figure out what classes and properties or methods to use is to use AMOBrowser sample application. It shows you the real hierachy of AMO objects.

For instance, using that application I was able to figure out that partition has a source object and then simple search for "partition.source" brought me to this aricle http://msdn2.microsoft.com/en-gb/library/ms345091.aspx

Where I discovered following code sample

static void CreateInternetSalesMeasureGroupPartitions(MeasureGroup mg)
{
Partition part;
part = mg.Partitions.FindByName("Internet_Sales_184");
if ( part != null)
part.Drop();
part = mg.Partitions.Add("Internet_Sales_184");
part.StorageMode = StorageMode.Molap;
part.Source = new QueryBinding(db.DataSources[0].ID, "SELECT * FROM [dbo].[FactInternetSales] WHERE OrderDateKey <= '184'");
part.Slice = "[Date].[Calendar Year].&[2001]";
part.Annotations.Add("LastOrderDateKey", "184");

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Thanks for the tip, Edward. I still haven't found the class that exposes the DSV's query binding (which I would use when generating a new partition's query binding), so I suppose I might have to do this manually.

The Annotations property looks pretty useful though, thanks!

Programmatic synchronizing and metadata

Hello,
I created a subscription programmatically so I have the
CreateSyncAgentByDefaut property = false. Do I have to do some additional
functions to work with and clean up the subscription metadata.
Thanks for your help.
When your subscription is deployed merge replication will fix your database
to replicate to it. It will automatically clean up metadata as it no longer
needs it.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Car" <Car@.discussions.microsoft.com> wrote in message
news:76F2D1C8-653B-4DD9-BAF9-3842221369E4@.microsoft.com...
> Hello,
> I created a subscription programmatically so I have the
> CreateSyncAgentByDefaut property = false. Do I have to do some additional
> functions to work with and clean up the subscription metadata.
> Thanks for your help.
>

programmatic rendering of multipage report

Hi,
I have created a multipage report (having almost 40 pages). I need to
render this report programmatically.
Is there any way to get the report pages as and when required (i.e.
when user clicks on <next> button).
I am able to render single page report using render() method. How to do
so for multipage report.
regards,
Sachin.What are you rendering it as? Image, HTML?
For an Image type you can specify the start page as part of the DeviceInfo.
Craig
"sachin laddha" <sachinladdha@.gmail.com> wrote in message
news:1142572855.966655.266270@.v46g2000cwv.googlegroups.com...
> Hi,
> I have created a multipage report (having almost 40 pages). I need to
> render this report programmatically.
> Is there any way to get the report pages as and when required (i.e.
> when user clicks on <next> button).
> I am able to render single page report using render() method. How to do
> so for multipage report.
> regards,
> Sachin.
>|||Hi,
I need to render it as HTML and PDF. Also Is it possible to find out
number of report pages in advance.
regards,
sachin.|||http://groups.google.com/group/microsoft.public.sqlserver.reportingsvcs/tree/browse_frm/thread/5a73412801f5ba54/f63ce6b85e448735?rnum=1&hl=en&q=%22Oleg+Yevteyev%22+pages&_done=%2Fgroup%2Fmicrosoft.public.sqlserver.reportingsvcs%2Fbrowse_frm%2Fthread%2F5a73412801f5ba54%2F41e4ed35916811eb%3Flnk%3Dst%26q%3D%22Oleg+Yevteyev%22+pages%26rnum%3D8%26hl%3Den%26#doc_ac075ac1383673e8
That is for HTML4.0 rendering
Hope it helps.
--
Oleg Yevteyev,
San Diego, CA
It is OK to contact me with a contracting opportunity.
"myfirstname"001atgmaildotcom.
Replace "myfirstname" with Oleg.
--
"sachin laddha" <sachinladdha@.gmail.com> wrote in message
news:1142578108.796952.163040@.z34g2000cwc.googlegroups.com...
> Hi,
> I need to render it as HTML and PDF. Also Is it possible to find out
> number of report pages in advance.
> regards,
> sachin.
>

Programmatic Rendering C# - passing Oracle credentials

What am I doing wrong here? I am trying to programmatcially run a report that
uses an Oracle stored procedure where the Oracle credentials would be
prompted if I ran interactively. The program (C#) compiles OK but I get an
'Object reference not set to an instance of an object' error when assigning
the credential property. The report runs interactively and I can
programmatically pass other parameters other than oracle credentials.
DataSourceCredentials[] credentials = new DataSourceCredentials[1];
credentials[0].DataSourceName = "MyDataSource";
credentials[0].UserName = "MyUser";
credentials[0].Password = "MyPassword";
data = _rs.Render("/MyFolder/MyReport","PDF", null, null, returnValues,
credentials , null, out encoding, out mimeType, out parametersUsed, out
warnings, out streamIds);
Any help appreciated.Sorry - just spotted it , I was missing a
credentials[0] = new DataSourceCredentials();
prior to assigning properties
"Joe" wrote:
> What am I doing wrong here? I am trying to programmatcially run a report that
> uses an Oracle stored procedure where the Oracle credentials would be
> prompted if I ran interactively. The program (C#) compiles OK but I get an
> 'Object reference not set to an instance of an object' error when assigning
> the credential property. The report runs interactively and I can
> programmatically pass other parameters other than oracle credentials.
> DataSourceCredentials[] credentials = new DataSourceCredentials[1];
> credentials[0].DataSourceName = "MyDataSource";
> credentials[0].UserName = "MyUser";
> credentials[0].Password = "MyPassword";
> data = _rs.Render("/MyFolder/MyReport","PDF", null, null, returnValues,
> credentials , null, out encoding, out mimeType, out parametersUsed, out
> warnings, out streamIds);
> Any help appreciated.

Programmatic Render of Reports into PDF format

Hi,
Can anybody please convert the following C# code into VB.Net Code.I tried
but its saying Object Reference not set to an instance of an object.
Or give me VB.NET(Web Application, CodeBehind:VB.Net) code to
programmatically render reports into PDF format.
// Prepare report parameter.
ParameterValue[] parameters = new ParameterValue[1];
parameters[0] = new ParameterValue();
parameters[0].Name = "Parameter1";
parameters[0].Value = Request.QueryString["id"];
Thanks
Rajesh YDim Parameters(1) As New ParameterValue
Parameters(0) = New ParameterValue
Parameters(0).Name = "Parameter1"
Parameters(0).Value = Request.QueryString("id")
"Rajesh Yennam" wrote:
> Hi,
> Can anybody please convert the following C# code into VB.Net Code.I tried
> but its saying Object Reference not set to an instance of an object.
> Or give me VB.NET(Web Application, CodeBehind:VB.Net) code to
> programmatically render reports into PDF format.
> // Prepare report parameter.
> ParameterValue[] parameters = new ParameterValue[1];
> parameters[0] = new ParameterValue();
> parameters[0].Name = "Parameter1";
> parameters[0].Value = Request.QueryString["id"];
> Thanks
> Rajesh Y|||Hi Rajesh:
I'd suspect the line of code :
parameters[0].Value = Request.QueryString["id"];
I'd guess you do not have an id parameter in the query string. Double
check the query string.
HTH,
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Fri, 29 Oct 2004 03:43:01 -0700, "Rajesh Yennam"
<RajeshYennam@.discussions.microsoft.com> wrote:
>Hi,
>Can anybody please convert the following C# code into VB.Net Code.I tried
>but its saying Object Reference not set to an instance of an object.
>Or give me VB.NET(Web Application, CodeBehind:VB.Net) code to
>programmatically render reports into PDF format.
>// Prepare report parameter.
> ParameterValue[] parameters = new ParameterValue[1];
> parameters[0] = new ParameterValue();
> parameters[0].Name = "Parameter1";
> parameters[0].Value = Request.QueryString["id"];
>Thanks
>Rajesh Y

Programmatic logon to replication agent?

Greetings,
I have developed custom replication software that I have been running
in house for 2 years now. During replication operations I have been
SETting IDENT_INSERT OFF and then back ON again (after replication
completes). I have also been disabling and re-enabling my
CONSTRAINTS. I have since learned that it is better to use the "NOT
FOR REPLICATION" option in these cases to avoid the additional
overhead.
As I understand the "NOT FOR REPLICATION" option, it will do
everything that I want it to do during my replication process so long
as I have logged on as a replication agent.
1. What do I have to do in my custom program to authenticate it as a
replication agent? (My goal is for the NOT FOR REPLICATION settings
to "kick in" only during the scheduled execution of my program.) I am
coding in C# using .NET.
2. Will I have to somehow create a replication agent profile or is
there a default one that I can use?
3. Since my program runs all day in the background, will it be
necessary to "log off" as a replication agent during dormant periods?
(I don't want my program to interfere with the smooth runnings of
daily business operations occurring during normal business hours.)
I have spent much time looking for this answer both online and in the
SQL Server help. Your recommendation will be greatly appreciated.
Mario T. Lanza
Clarity Information Architecture, Inc.
2004.09
Mario,
if you use queued updating subscribers, the Identity (Yes, not for
replication) property is sent to the subscriber during the initial snapshot.
The insert stored procedure that the distribution agent uses is different to
the normal one, and at the start has the statement:
BEGIN
set identity insert "tablename" on
....
As you see, this is no different to what you are already using, and is not
inbuilt into the replication agent as such.
HTH,
Paul Ibison
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||I'm sorry but I am using a custom application that handles all aspects
of replication. It builds parameterized insert/update SQL
dynamically. Although I could set identity insert ON then OFF before
and after each row, I would rather do it before and after all the rows
of the table have been inserted/updated. The issue lies in the fact
that the application may be manually or abnormally terminated prior to
my clean up code.
One of the main things my clean up code does is:
1. Restores the identity insert to OFF
2. Restores all CHECK constraints
I have a CHECK constraint on each table which throws an exception if
the proposed identity value is outside of the assigned range at the
store location.
As such, I'm not sure you answered my question.
What do I do so that the "NOT FOR REPLICATION" settings are observed
only when my *custom* replication agent application is running.
Bear in mind I am not using anything provided by Microsoft for
replication.
Thanks.
Mario
|||Mario,
I was comparing your situation to transactional queued
updating subscribers. In this replication setup there is
no global identity insert setting for the agent - it is
set on an individual row insert, in the text of a stored
procedure. However, another poster has mentioned the same
thing in the context of merge replication, where the
agent itself appears to be able to make a global setting
of identity insert. He wanted to be able to execute his
code and 'pretend' to be the merge agent in order to take
advantage of tihs setting, but was unable to do so. Quite
how this is enabled is undocumented and not in the public
domain AFAIK.
Regards,
Paul Ibison
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||That's unfortunate. I was hoping that someone had overcome this issue.
In any case, thanks for responding. I appreciate your effort.
Mario
|||I had the same problem and could not find any solution. I finally found
a merge replication guru guy. He is actually a contractor in Toronto
and selling a special component which is totally able to pretend to be
merge agent.
It is simple to use but may be a little bit expensive for start-up
companies. Since we desperately needed that feature the company just
paid for it instead of digging for weeks over weeks.
It gets SQL Server credentials as class properties and you call
ExecuteSQL method, it executes it as if it is merge agent.
For example I can execute the following SQL against my DB using that
component:
INSERT myTable (IdentityField, column1, column2) VALUES (5, 'test',
test')
and it works!!
you do not need to say SET IDENTITY_INSERT ON/OFF or disable any
constraints.
If you need to contact that merge replication consultant just send me
an email.
Nury Sword
NurySword@.hotmail.com
MCSD - MCDBA
Toronto

Programmatic killing connections

We want to create canned database restore jobs - possibly
as DTS packages.
We believe we need a way to find and kill database
connections, so that the actual restore can proceed.
Anyone done this ?
TIA
Hi Jim
Killing connections is one way. Another is to put the database into single
user mode, using the rollback immediate option, eg:
alter database [dbname] set single_user with rollback immediate
Check out ALTER DATABASE in Books Online for more info:
http://msdn.microsoft.com/library/en...aa-az_4e5h.asp
HTH
Regards,
Greg Linwood
SQL Server MVP
"Jim Trowbridge" <jtrowbridge@.adelaidebank.com.au> wrote in message
news:ba1001c479c2$5c468bc0$a601280a@.phx.gbl...
> We want to create canned database restore jobs - possibly
> as DTS packages.
> We believe we need a way to find and kill database
> connections, so that the actual restore can proceed.
> Anyone done this ?
> TIA
|||I found a sample script to close all connections on:
http://khsw.blogspot.com/2004/08/sto...nnect-all.html
"Jim Trowbridge" <jtrowbridge@.adelaidebank.com.au> wrote in message news:<ba1001c479c2$5c468bc0$a601280a@.phx.gbl>...
> We want to create canned database restore jobs - possibly
> as DTS packages.
> We believe we need a way to find and kill database
> connections, so that the actual restore can proceed.
> Anyone done this ?
> TIA

Programmatic killing connections

We want to create canned database restore jobs - possibly
as DTS packages.
We believe we need a way to find and kill database
connections, so that the actual restore can proceed.
Anyone done this ?
TIAHi Jim
Killing connections is one way. Another is to put the database into single
user mode, using the rollback immediate option, eg:
alter database [dbname] set single_user with rollback immediate
Check out ALTER DATABASE in Books Online for more info:
http://msdn.microsoft.com/library/e..._aa-az_4e5h.asp
HTH
Regards,
Greg Linwood
SQL Server MVP
"Jim Trowbridge" <jtrowbridge@.adelaidebank.com.au> wrote in message
news:ba1001c479c2$5c468bc0$a601280a@.phx.gbl...
> We want to create canned database restore jobs - possibly
> as DTS packages.
> We believe we need a way to find and kill database
> connections, so that the actual restore can proceed.
> Anyone done this ?
> TIA|||I found a sample script to close all connections on:
http://khsw.blogspot.com/2004/08/st...onnect-all.html
"Jim Trowbridge" <jtrowbridge@.adelaidebank.com.au> wrote in message news:<ba1001c479c2$5c468
bc0$a601280a@.phx.gbl>...
> We want to create canned database restore jobs - possibly
> as DTS packages.
> We believe we need a way to find and kill database
> connections, so that the actual restore can proceed.
> Anyone done this ?
> TIA

Programmatic killing connections

We want to create canned database restore jobs - possibly
as DTS packages.
We believe we need a way to find and kill database
connections, so that the actual restore can proceed.
Anyone done this ?
TIAHi Jim
Killing connections is one way. Another is to put the database into single
user mode, using the rollback immediate option, eg:
alter database [dbname] set single_user with rollback immediate
Check out ALTER DATABASE in Books Online for more info:
http://msdn.microsoft.com/library/en-us/tsqlref/ts_aa-az_4e5h.asp
HTH
Regards,
Greg Linwood
SQL Server MVP
"Jim Trowbridge" <jtrowbridge@.adelaidebank.com.au> wrote in message
news:ba1001c479c2$5c468bc0$a601280a@.phx.gbl...
> We want to create canned database restore jobs - possibly
> as DTS packages.
> We believe we need a way to find and kill database
> connections, so that the actual restore can proceed.
> Anyone done this ?
> TIA|||I found a sample script to close all connections on:
http://khsw.blogspot.com/2004/08/stored-procedure-to-disconnect-all.html
"Jim Trowbridge" <jtrowbridge@.adelaidebank.com.au> wrote in message news:<ba1001c479c2$5c468bc0$a601280a@.phx.gbl>...
> We want to create canned database restore jobs - possibly
> as DTS packages.
> We believe we need a way to find and kill database
> connections, so that the actual restore can proceed.
> Anyone done this ?
> TIA

Saturday, February 25, 2012

Programmatic inspection of a dump?

I need to set up a job to allow users to restore their databases, on SQL Server 2000 SP3. The idea is that a user inserts a record into a table, identifying the dump they want to load. (They can only restore their own account.) A job picks up this record, restores the database, and notifies the user as appropriate.

My part of this is writing the procedure that the job executes, including the dump restore. Part of that is getting each dump's file groups (data, index, and log) into the proper locations for this server and this user.

Essentially, I need to be able to access the results of 'load filelistonly' from a cursor. How do I access the file list?Essentially, I need to be able to access the results of 'load filelistonly' from a cursor. How do I access the file list?
Google is your friend. http://www.karaszi.com/sqlserver/util_restore_all_in_file.asp|||Man .. its better if you do not call the backup a dump (You know what I mean !!!)... coz its what will save your A$$ when the database goes down ...

Programmatic insert into SQL database

I have a page with over 20 Textbox and DDL controls and an upload in various Divs and Panels (Ajax enabled) that are used for gathering user data. Some of the fields are mandatory and some optional.

In the Code behind (VB- I am a complete novice) On the submit button click event, I iterate through the controls in the page and build an array with information from the controls that have data in them, (filtering out the non-filled textboxes, and DDLs).

All this works well, and I get an array called 'myInfo' with the columns with the control ID, and control values 'rvalue' (as string), with the number of rows equal to the filled textboxes and DDLs.

I then step through the array and build a string with 'name=values' of all the rows in the myinfo array and email this as a message:

ThisMessage = ""
NoOfControls = myInfo.GetLength(0)
For i = 0 To NoOfControls - 1
ThisMessage = ThisMessage & myInfo(i).ID.ToString & "=" & myInfo(i).rvalue.ToString & "; "
Next

SendMail(email address, ThisMessage)

I also want to add this information to a database, appended by the IP address and datetime.now.

Dim evdoDataSource As New SqlDataSource()
evdoDataSource.ConnectionString = ConfigurationManager.ConnectionStrings("SQLConnectionStringCK").ToString
evdoDataSource.InsertCommandType = SqlDataSourceCommandType.Text

Dim InsertMessage As String = """INSERT INTO evdoData ("
NoOfControls = myInfo.GetLength(0)

Dim k As Integer
For k = 0 To NoOfControls - 1
InsertMessage = InsertMessage & myInfo(k).ID.ToString & ", "
Next

InsertMessage = InsertMessage & "IPNo, DateEntered) VALUES ("

For k = 0 To NoOfControls - 1
InsertMessage = InsertMessage & "@." & myInfo(k).ID.ToString & ", "
Next
InsertMessage = InsertMessage & ", @.IPNo, @.DateEntered" & ")"""

evdoDataSource.InsertCommand = InsertMessage

I then similarly iterate through and do the insertparameters.

Now here is the rub- (My all too often DUH moment!)

When I look at the insertmessage in debug (and to be sure- I also show the insert string on a temporary debug label on the page), The insertmessage looks fine:

"INSERT INTO EvdData (FirstName, Age, Email, Phone, Country, City, IPNo, DateEntered) VALUES (@.FirstName, @.Age, @.Email, @.Phone, @.Country, @.City, , @.IPNo, @.DateEntered)"

However when the above code(evdoDataSource.InsertCommand = InsertMessage) is run, I get an error - the message with the error is:

The identifier that starts with 'INSERT INTO ModelData (FirstName, Age, Email, Phone, Country, City, IPNo, DateEntered) VALUES (@.FirsteName, @.Age, @.Email, @.Phone,' is too long. Maximum length is 128

EH? When I actually copy the InsertMessage from the debug window and paste it manually after the command "evdoDataSource.InsertCommand = " It works, and I get the data inserted into the table..

-It would seem that I am probably missing something obvious in my complete "noviceness" . HELP! (oh and thanks a bunch in anticipation)

_____________________________________________________________________________________________________________________

Its Easy --------When you know How. Meanwhile Aaaaaaaaah .

Remove the double-quotes around the insert statement.

Dim InsertMessageAs String ="INSERT INTO evdoData (" NoOfControls = myInfo.GetLength(0)Dim kAs Integer For k = 0To NoOfControls - 1 InsertMessage = InsertMessage & myInfo(k).ID.ToString &", "Next InsertMessage = InsertMessage &"IPNo, DateEntered) VALUES ("For k = 0To NoOfControls - 1 InsertMessage = InsertMessage &"@." & myInfo(k).ID.ToString &", "Next InsertMessage = InsertMessage &", @.IPNo, @.DateEntered)"

|||

In the post the you have an extra comma in your insert statement after @.City and before @.IPNo

INSERT INTO EvdData (FirstName, Age, Email, Phone,Country, City, IPNo, DateEntered) VALUES (@.FirstName, @.Age, @.Email,@.Phone, @.Country, @.City, , @.IPNo, @.DateEntered)

You may want to change

InsertMessage = InsertMessage & ", @.IPNo, @.DateEntered" & ")"""

to

InsertMessage = InsertMessage & "@.IPNo, @.DateEntered" & ")"""

|||

First, don't use " (double quotes) in your query, instead use ' (single quote) if and when needed. If at all you have to use double quotes then prefer setting QUOTED_IDENTIFIER OFF for the connection object. This sounds bit tricky, right?

kj@.zqtech.com:

"INSERT INTO EvdData (FirstName, Age, Email, Phone, Country, City, IPNo, DateEntered) VALUES (@.FirstName, @.Age, @.Email, @.Phone, @.Country, @.City, , @.IPNo, @.DateEntered)"

Second, did you notice that there are 2 , (comma) between @.city and @.IPNO or this is just by mistake when you were pasting your code in the post ?

Hope this will help.

|||

Thanks Guys. It was the combination of both things. No quotations required and also the extra comma. (Silly look on my face at this point).

Moral of the story:

1. Coding problems are like magician's tricks: one problem is a slight of hand to take your attention away from another. 2. Beware of taking error messages too literally. -

Programmatic access to the code SQLCMD uses to parse sql into batches

Hi,

I am thinking of writing a C# Windows app to iterate a set of sql scripts and submit them to SQL Server. Many scripts have "go" as a batch delimiter. I could probably figure out a regular expression to parse for that delimiter, but it seems tricky (need to exclude 'go', -- go, /* go */, etc). Obviously SQLCMD and Management Studio have a way to do this. I was wondering if that's exposed in an API anywhere. I looked into the SMO object model, but I couldn't find it.

Thanks much,

Mike

Hi,

thats no mafic, just use the SET PARSEONLY statement before your statements to check.

HTH, Jens Suessmeyer.


http://www.sqlserver2005.de

|||

As far as I can tell "set parseonly on" just checks the syntax. I want to get back a collection of strings to submit, each one a proper batch. Eg:

select 'Inside quotes, go or " go " or '' go '' is not a delimiter ' as go -- not go here

select 'Second go '

go

select 'Another batch here /* go */ go '

go

In query analyzer or management studio this appropriately returns 3 result sets, presumably executed as 2 batches. I would like to identify the first 2 lines as one batch, and the second select as another batch.

Mike

Programmatic Access to SQL database


New at this and would like to get the code in VB or . Net which would
allow connection, reading and writing to a SQL database previously
created.
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!Try taking a look here, there are many examples to choose from...
http://gotdotnet.com/Community/User...?query=database
"John Brown" wrote:

>
> New at this and would like to get the code in VB or . Net which would
> allow connection, reading and writing to a SQL database previously
> created.
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!
>

Programmatic access to Enabled Protocols in SQL2005?

My C++ program is able to read the "Enabled Protocols" for SQL2005 by
reading the registry at:
HKLM\Software\Microsoft\Microsoft SQL Server\<instance
name>\MSSQLServer\SuperSocketLib\<protocol alias> and then reading the
"Enabled" value to see if it is enabled or not.
This works fine for named instances, but I can't find the registry values
that tell me which Enabled Protocols are defined for the default instance in
SQL2005.
Can anyone assist?
Many thanks!Hi,
Thanks for your post!
From your description, I understand that:
Your application need to search for the SQL Server 2005 enabled protocols
information in registry.
You managed to get the "Enable" value if the SQL Server was installed as a
named instance;
however the "Enable" value was not found at that location if the SQL Server
was installed as a default instance.
If I have misunderstood, please let me know.
From my research, I found the "Enable" value was under the directory
"HKLM\Software\Microsoft\Microsoft SQL
Server\MSSQL.1\MSSQLServer\SuperSocketNetLib\<protocol alias>",
which was different from yours. My SQL Server 2005 was installed as a named
instance as well.
The directory as you mentioned is also existed in my registry, however I
couldn't find the "Enable" value under that.
In fact, if your SQL Server 2005 was installed as a default instance, you
may found the default value "MSSQLServer" under
HKLM\Software\Microsoft\Microsoft SQL Server\MSSQL.x\MSSQLServer\
Both default instance and named instance have the related registry key
MSSQL.x. The registry directory "MSSQL.1" references the first instance of
your SQL Server 2005, so I recommend you check that registry directory
firstly.
Also, you may try to search for the key value "SuperSocketNetLib" under the
registry directory "HKLM\Software\Microsoft\".
If you have any other concerns, please feel free to let me know. It's my
pleasure to be of assistance.
+++++++++++++++++++++++++++
Charles Wang
Microsoft Online Partner Support
+++++++++++++++++++++++++++
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
Business-Critical Phone Support (BCPS) provides you with technical phone
support at no charge during critical LAN outages or "business down"
situations. This benefit is available 24 hours a day, 7 days a w to all
Microsoft technology partners in the United States and Canada.
This and other support options are available here:
BCPS:
https://partner.microsoft.com/US/te...erview/40010469
Others:
https://partner.microsoft.com/US/te...upportoverview/
If you are outside the United States, please visit our International
Support page:
http://support.microsoft.com/defaul...rnational.aspx.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi,
Just checking in to see if the suggestions were helpful. Please let us know
if you would like further assistance.
Have a great day!
+++++++++++++++++++++++++++
Charles Wang
Microsoft Online Partner Support
+++++++++++++++++++++++++++
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
Business-Critical Phone Support (BCPS) provides you with technical phone
support at no charge during critical LAN outages or "business down"
situations. This benefit is available 24 hours a day, 7 days a w to all
Microsoft technology partners in the United States and Canada.
This and other support options are available here:
BCPS:
https://partner.microsoft.com/US/te...erview/40010469
Others:
https://partner.microsoft.com/US/te...upportoverview/
If you are outside the United States, please visit our International
Support page:
http://support.microsoft.com/defaul...rnational.aspx.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

Programmatic "Script Table as Create to..." in T-SQL?

Is there a way to write a T-SQL query against the database object model to create the same output as you would get when you right-click the object in Management Studio and select 'Script table as Create to.."?

Or better yet, is there a way to retrieve the DDL that was used to create a table using a T-SQL query?

Thanks in advance,
-Preston M. Price

Perhaps something like this:

SELECT text

FROM sys.syscomments

WHERE id = object_id( 'MyStoredProcedure' )

|||

There is no way to query DDL from the database (beside the Routine_definition your get from INFORMATION_SCHEMA.Routines table or the sysobejcts as Arnie pointed out), you will have to either write your own way to do this or you can use API of SMO to do the stuff with the scripter object.

Jens K. Suessmeyer.

http://www.sqlserver2005.de

Programmatic "Script Table as Create to..." in T-SQL?

Is there a way to write a T-SQL query against the database object model to create the same output as you would get when you right-click the object in Management Studio and select 'Script table as Create to.."?

Or better yet, is there a way to retrieve the DDL that was used to create a table using a T-SQL query?

Thanks in advance,
-Preston M. Price

Perhaps something like this:

SELECT text

FROM sys.syscomments

WHERE id = object_id( 'MyStoredProcedure' )

|||

There is no way to query DDL from the database (beside the Routine_definition your get from INFORMATION_SCHEMA.Routines table or the sysobejcts as Arnie pointed out), you will have to either write your own way to do this or you can use API of SMO to do the stuff with the scripter object.

Jens K. Suessmeyer.

http://www.sqlserver2005.de