Friday, March 30, 2012
is there a syntax t-sql for generate sql scripts.
sql script of objects (table, view, stored procedure,..)?
I know we can do manualy from right click and then click
generate all scripts ? but can we do it with programming ?
thanks.For most stored procedures (assuming they are <= 8000 characters) you can
use sp_helptext, you can also SELECT ROUTINE_DEFINITION FROM
INFORMATION_SCHEMA.ROUTINES in your script.
For tables, it's a little more complicated, especially if you have
primary/foreign keys, constraints, default values, etc. I think if you're
going about it this way: create the tables, then script them properly, you
should think about doing it the other way around. :-)
"kresna rudy kurniawan" <kresna_rk@.hotmail.com> wrote in message
news:03e901c39c3b$d15a5eb0$a401280a@.phx.gbl...
> Is there syntaxs t-sql, function or others to generate
> sql script of objects (table, view, stored procedure,..)?
> I know we can do manualy from right click and then click
> generate all scripts ? but can we do it with programming ?
> thanks.|||> generate all scripts ? but can we do it with programming ?
Your best bet is SQL-DMO. Though you can invoke SQL-DMO objects and their
Script methods via T-SQL's sp_OAxxx procedures, you are much better off
using a scripting language such as VB or Perl.
Of course, if you like to do it the hard way and like to re-invent the
wheel, you can always query the system tables and construct the scripts
entirely in T-SQL. That won't be pretty though.
--
Linchi Shea
linchi_shea@.NOSPAMml.com
"kresna rudy kurniawan" <kresna_rk@.hotmail.com> wrote in message
news:03e901c39c3b$d15a5eb0$a401280a@.phx.gbl...
> Is there syntaxs t-sql, function or others to generate
> sql script of objects (table, view, stored procedure,..)?
> I know we can do manualy from right click and then click
> generate all scripts ? but can we do it with programming ?
> thanks.
Monday, March 26, 2012
is there a collection of all database objects
There are a number of collections within the Database object in SMO which you can use, such as Tables, Triggers, StoredProcedures, Users and Views. Each of these is a collection of the named objects within the database. (At the Server level of course, there's a Databases collection which will get you to each Database object on the server.)
Hope that helps.
sqlWednesday, March 7, 2012
Is Reporting Services Suppot to take the RDL Report Objects in Windows Form
i have place the textboxes in RDL report in Reporting Services and set there name. i want to access those text boxes from the Windows Form.
For Example
In Windows Form
Dim obj as RDLReport
Obj.TextBox1.Text="Ali How are you"
.Can i do that.?
No. You can set the properties of the text box to be an expression, but you cannot programmatically write to the text box like that.|||To do something like this you should bind the text in the textbox to a parameter value, and then pass that parameter to your viewer control.