Showing posts with label generate. Show all posts
Showing posts with label generate. Show all posts

Wednesday, March 21, 2012

How can I make SQL Server automatic generate scheme script for backup everyday?

How can I make SQL Server automatic generate scheme script for backup
everyday?Google "scptxfr.exe". It's a tool from Microsoft used in the Upgrade
process, but it'll work for this.
see
http://www.databasejournal.com/feat...10894_3401081_1
for an example.
HTH,
Stu|||Wow, so fast replied. Very thanks
"Stu" <stuart.ainsworth@.gmail.com> wrote in message
news:1133921881.553339.60870@.g43g2000cwa.googlegroups.com...
> Google "scptxfr.exe". It's a tool from Microsoft used in the Upgrade
> process, but it'll work for this.
> see
> http://www.databasejournal.com/feat...10894_3401081_1
> for an example.
> HTH,
> Stu
>sql

How can I make SQL Server 2005 automatic generate scheme script for backup everyday?

How can I make SQL Server 2005 automatic generate scheme script for backup
everyday?"ABC" <abc@.abc.com> wrote in message
news:ef5YwPOEGHA.1312@.TK2MSFTNGP09.phx.gbl...
> How can I make SQL Server 2005 automatic generate scheme script for backup
> everyday?
>
>
I believe you could use the SMO Scripter class to achieve this.
If your schema is in development I'd recommend you use a source control
program to backup the source code. Or you can use utilities like DBGhost or
RedGate SQL Compare to script the changes.
David Portas
SQL Server MVP
--

Monday, March 19, 2012

How can i make a report like this.

Hello,
I'm quite new with this about reports I need to do a report with this:
My database was made like a tree because it generate a document with titles and subtitle.
Parent id ID Description Text
0 1 Title <b>text in html format </b>
1 2 Subtitle I <b>text in html format </b>
1 3 Subtitle II <b>text in html format </b>
2 4 Subtitle 1.1 <b>text in html format </b>
2 5 Subtitle 1.2 <b>text in html format </b>
3 6 Subtitle 2.1 <b>text in html format </b>
3 7 Subtitle 2.2 <b>text in html format </b>
All the text was saved like HTML, it includes images that was saved in a directory in my IIS directory.
I have to put all this information and make a report like.
Title
Subtitle I
Subtitle 1.1
Text in html format
Subtitle 1.2
Text in html format
Subtitle II
Subtitle 2.1
etc.....
Well, I don't know how start! And what to use.

I tryed to use the ABDpdf but it has a lot of issues with the security, I think that a Crystal Report or SQL Reporting Services could be more integrated with the security.
Can you help to know what to use and a tip for where to start?
Thank you a lot.Reporting Services has an example regarding to this type of hierarchy/grouping reports. Look into "Grouping Data in a Report" sample/walkthrough and you should be able to create your report. Hope this helps.

Wednesday, March 7, 2012

How can I grant create permission for stored procedures?

My company has an SQL server hosted at a server farm. An outside
consultant is developing some stored procedures to generate some
reports using the data in the SQL Server database that our application
uses.
The developer will have access to the SQL server via Enterprise
Manager using his own login. I need to give him the right to create
stored procedures in a sandbox database while limiting his other
abilities to select only. When I look at the permissions on stored
procedures I see that I can allow or deny the ability to execute them
but I am not sure how to allow stored procedure creation priviledges.
Can this be done?
TIAGrant the user the statement permission, for example:
GRANT CREATE PROCEDURE to SomeUser
-Sue
On Thu, 07 Jul 2005 18:42:17 -0400, Matthew Speed
<mspeed@.mspeed.net> wrote:

>My company has an SQL server hosted at a server farm. An outside
>consultant is developing some stored procedures to generate some
>reports using the data in the SQL Server database that our application
>uses.
>The developer will have access to the SQL server via Enterprise
>Manager using his own login. I need to give him the right to create
>stored procedures in a sandbox database while limiting his other
>abilities to select only. When I look at the permissions on stored
>procedures I see that I can allow or deny the ability to execute them
>but I am not sure how to allow stored procedure creation priviledges.
>Can this be done?
>TIA

Sunday, February 19, 2012

How can I generate xsd files from existing tables?

I would like to generate xml schema files for my data model for later use with testing tools such as ndbunit. I realize that Visual Studio datasets can be used to do this, however, Visual Studio does not automatically determine table realtionships. I do not want to manually specify these relationships. I also do not have the luxury of using TeamServer for DB professionals. The Database Diagrams feature of SQL Server Management Studio seems capable of determining the table relationships on its own. However, I don't see any way to simply export a databse diagram to an xml schema definition. I realize I could write code to do this myself using the nice APIs under the Microsoft.Sqlserver.management and System.xml namespace, but I'm trying to avoid doing this. Is there a way to do this with SQL Server Management Studio?

Would something like this work for you? It's not technically a "right-click" operation, but it does generate the schema:

SELECT *
FROM Customers
FOR XML RAW('Customer'), XMLSCHEMA('urn:example.com')
-

<xsd:schema targetNamespace="urn:example.com"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sqltypes=
"http://schemas.microsoft.com/sqlserver/2004/sqltypes"
elementFormDefault="qualified">
<xsd:import namespace=
"http://schemas.microsoft.com/sqlserver/2004/sqltypes" />
<xsd:element name="Customer">
...
</xsd:element>
</xsd:schema>
<Customer xmlns="urn:example.com" CustomerID="ALFKI" CompanyName="Alfreds Futterkiste" ContactName="Maria Anders" ContactTitle="Sales Representative" Address="Obere Str. 57" City="Berlin" PostalCode="12209" Country="Germany" Phone="030-0074321" Fax="030-0076545" />
...

|||Thanks for the suggestion. This will work fine for my needs!|||

I should be a little clearer. If you want just the schema for the table, select something that returns all nulls or an empty set, but make sure you use the XMLSCHEMA option. You can find more about that in Books Online - past this in the "URL" bar of BOL:

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/04b35145-1cca-45f4-9eb7-990abf2e647d.htm

Buck

|||When using the XMLSCHEMA option, I cannot seem to get the generated schema to contain foreign key constraints. I looked over the MSDN documentation, but I have not found any specific options related to this. Is this a limitation or am I simply missing some parameters that will cause the contraints to be included?|||You're not missing anything - it definitely won't do that. I would suggest you live.com search for a "database documenter" script (there are tons out there) and add the XMLSCHEMA to the end of one of those. That should give you a database design in an XML document.

How can I generate variables automatically?

Hi there

I need to generate some variables , like var1, var2, var3 ...

It's determined by how many records in my database.

I want to write a for() to do this. But how?

For example

for(int i=0; i<datatable.rows.count; i++)
{
String vari = new String;
}

This is not a right way in C#, does anyone know how to?

Thanks!!!

int _intTotalRowCount=0;

_intTotalRowCount=DataBaseTable.RowsCount;

string _strVar ="";for (int _intCount = 0; _intCount <_intTotalRowCount; _intCount++)

{

_strVar = _strVar+","+ "Var" +_intCount.ToString();

}

Label1.Text= _strVar;

How can I generate INSERT statements from Management Studio

Hello All,

How are you guys doing? Hope all is well.

This is my problem...I accidentally deleted a bunch of my SQL scripts and would like to generate the INSERT statements from Management Studio. I am currently using SQLExpress. Is there a way I can accomprish my task? Kindly advise.

Thanks a bunch!

Mohammed

No, you can′t SSMS does not support that yet. You can create the statements using the script from here:

http://vyaskn.tripod.com/code.htm#inserts

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

hi Mohammed,

in addition to Jens, you can have a look at http://www.karaszi.com/sqlserver/info_generate_script.asp, where "several" option are listed.. for your convenience, you can perhaps try a free prj of mine, amInsert, available for free at the link following my sign..

regards

|||

Hello Jens!

Good to hear from you and thank you for responding to my post. I really appreciate your assistance. I used to live in Germany myself...in Bonn....and I had an amazing time...and I would love to go back there!!!

Thanks again,

Mohammed

|||

Hello Jens,

Sorry to bug you again. Would I be able to generate the INSERT statements if I was using full-blown SQL Server 2005?...or does this have nothing to do with the fact that I am using SQL Server Express?

Thanks,

Mohammed

|||

hi Mohammed,

even SQL Server Management Studio "full version" does not provide that feature..

regards

How can I generate INSERT statements from Management Studio

Hello All,

How are you guys doing? Hope all is well.

This is my problem...I accidentally deleted a bunch of my SQL scripts and would like to generate the INSERT statements from Management Studio. I am currently using SQLExpress. Is there a way I can accomprish my task? Kindly advise.

Thanks a bunch!

Mohammed

No, you can′t SSMS does not support that yet. You can create the statements using the script from here:

http://vyaskn.tripod.com/code.htm#inserts

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

hi Mohammed,

in addition to Jens, you can have a look at http://www.karaszi.com/sqlserver/info_generate_script.asp, where "several" option are listed.. for your convenience, you can perhaps try a free prj of mine, amInsert, available for free at the link following my sign..

regards

|||

Hello Jens!

Good to hear from you and thank you for responding to my post. I really appreciate your assistance. I used to live in Germany myself...in Bonn....and I had an amazing time...and I would love to go back there!!!

Thanks again,

Mohammed

|||

Hello Jens,

Sorry to bug you again. Would I be able to generate the INSERT statements if I was using full-blown SQL Server 2005?...or does this have nothing to do with the fact that I am using SQL Server Express?

Thanks,

Mohammed

|||

hi Mohammed,

even SQL Server Management Studio "full version" does not provide that feature..

regards

How can I generate insert statements for sample data?

Hi,
I want to post a question but I want to also include a script for you guys
to create the table on your end as well as some sample data.
I used to have a tool that would take the data in a table and generate a
bunch of INSERT statements. I can't seem to locate it. Could someone please
give me a pointer on where I can find that script?
--
Thanks,
SamSam wrote:
> Hi,
> I want to post a question but I want to also include a script for you
> guys to create the table on your end as well as some sample data.
> I used to have a tool that would take the data in a table and
> generate a bunch of INSERT statements. I can't seem to locate it.
> Could someone please give me a pointer on where I can find that
> script?
www.aspfaq.com/5006
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"|||Find my post of yesterday :)
"Sam" <Sam@.discussions.microsoft.com> wrote in message
news:DF35D0A0-C291-4B03-9860-37DF09F92846@.microsoft.com...
> Hi,
> I want to post a question but I want to also include a script for you guys
> to create the table on your end as well as some sample data.
> I used to have a tool that would take the data in a table and generate a
> bunch of INSERT statements. I can't seem to locate it. Could someone
> please
> give me a pointer on where I can find that script?
> --
> Thanks,
> Sam|||To generate Insert statements from the existing data Check out
http://vyaskn.tripod.com/code.htm its really good.
Source code:: http://vyaskn.tripod.com/code/generate_inserts.txt
Best Regards
Vadivel
http://vadivel.blogspot.com
http://thinkingms.com/vadivel
"Mark Nijhof" wrote:

> Find my post of yesterday :)
>
> "Sam" <Sam@.discussions.microsoft.com> wrote in message
> news:DF35D0A0-C291-4B03-9860-37DF09F92846@.microsoft.com...
>
>|||Try www.sqlscripter.com to generate INSERT, UDPATE, Delete data scripts.
"Sam" wrote:

> Hi,
> I want to post a question but I want to also include a script for you guys
> to create the table on your end as well as some sample data.
> I used to have a tool that would take the data in a table and generate a
> bunch of INSERT statements. I can't seem to locate it. Could someone pleas
e
> give me a pointer on where I can find that script?
> --
> Thanks,
> Sam

How can I generate an SQL Script with the INSERT INTO instruction?

Hi,
I'd like to know if there is a way that I can generate a script with the
INSERT INTO instruction of the content of the table. I know how to generate
a script for the create table, drop the constraint, index, recreate the
table, constraint... but I need to have the content of the table into that
script. How can I do this? For the moment I do this by using a DTS that
generate a .txt file with the content of the table, and I add manualy the
INSERT INTO... instruction at the beginning of each row. A lost of time!
Thank you for your help.> I'd like to know if there is a way that I can generate a script with the
> INSERT INTO instruction of the content of the table.
http://www.aspfaq.com/5006 has a link to one such script.|||"Jacques Rhaume" <Jacques Rhaume@.discussions.microsoft.com> wrote in
message news:190EBD0A-275E-454A-851D-BF5083AD8D53@.microsoft.com...
> Hi,
> I'd like to know if there is a way that I can generate a script with the
> INSERT INTO instruction of the content of the table. I know how to
> generate
> a script for the create table, drop the constraint, index, recreate the
> table, constraint... but I need to have the content of the table into that
> script. How can I do this? For the moment I do this by using a DTS that
> generate a .txt file with the content of the table, and I add manualy the
> INSERT INTO... instruction at the beginning of each row. A lost of time!
> Thank you for your help.
http://vyaskn.tripod.com/code.htm#inserts
Try here.
Rick Sawtell
MCT, MCSD, MCDBA|||Not quite sure exactly what you are trying to do. You can generate create
and drop table scripts using QA, and right clicking on the table itself.
If you are just trying to get column names, try this:
Select column_name from
Information_Schema.columns where table_name = 'yourTable'
Archer
"Jacques Rhéaume" wrote:

> Hi,
> I'd like to know if there is a way that I can generate a script with the
> INSERT INTO instruction of the content of the table. I know how to genera
te
> a script for the create table, drop the constraint, index, recreate the
> table, constraint... but I need to have the content of the table into that
> script. How can I do this? For the moment I do this by using a DTS that
> generate a .txt file with the content of the table, and I add manualy the
> INSERT INTO... instruction at the beginning of each row. A lost of time!
> Thank you for your help.|||> Not quite sure exactly what you are trying to do. You can generate create
> and drop table scripts using QA, and right clicking on the table itself.
Jacques is also trying to script the data in the table.

How Can I generate a rdl file from a mdx query in VB.net or C#.net?

Is there some methods to generate the rdl file or reporting html page from a given mdx query language
For instance, I have a mdx query:
select dim1.a on rows, dim2.b on columns from cub1
How can I generate the corresponding rdl file to generate report html page with VB.net or C#.net?

I know that one can use xmltextwriter to write the rdl file but it is a difficult work.Is there some internal class in Vistual Studio have some methods to generate the rdl file?

Thanks

There's a good article here on this:

http://msdn2.microsoft.com/en-us/library/ms167274.aspx

There's also some 3rd party libraries out there.

http://www.rdlcomponents.com/