Monday, March 26, 2012
Generating XSD schema from an sql server table
Is it possible to automatically get the validation information from a table in SQL server?
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
<chris4england> wrote in message
news:%23Xb8L4NlEHA.3520@.tk2msftngp13.phx.gbl...
>I am using XSD schemas in .net but have to generate them manually.
> Is it possible to automatically get the validation information from a
> table in SQL server?
You could probably write a stored procedure that generated XSD from the
sysobjects table, but it would be pretty complex and might not contain all
the validation you need.
This would be the only way that I know of. Part of the problem is that XSD's
generally contain information that isn't in SQL Server.
Bryant
|||In SQL Server 2005, you will be able to infer an XSD for the RAW and AUTO
modes in FOR XML.
E.g.,
select top 0 * from table for xml auto, xmlschema
In SQL Server 2000, you can generate an XDR schema in the following way
select top 0 * from table for xml auto, xmldata
and then use one of the XDR->XSD tools to generate the XSD from it.
Note that you probably still want to then edit the schema to add your own
constraints.
Best regards
Michael
"Bryant Likes" <bryant@.suespammers.org> wrote in message
news:u9ykRxblEHA.3104@.TK2MSFTNGP14.phx.gbl...
> <chris4england> wrote in message
> news:%23Xb8L4NlEHA.3520@.tk2msftngp13.phx.gbl...
> You could probably write a stored procedure that generated XSD from the
> sysobjects table, but it would be pretty complex and might not contain all
> the validation you need.
> This would be the only way that I know of. Part of the problem is that
> XSD's generally contain information that isn't in SQL Server.
> --
> Bryant
>
Wednesday, March 21, 2012
generating reports and saving them on the disk
Hi,
I want to know how to generate reports as pdf and save them on the disk 'automatically' at regular intervals. I have seen some links by googling but none satisfactory. If any of you have already done this and it works well for you, please share the info.
Can they be saved to the database automatically?
Please give you answer considering that all this is very new to me :)
I appreciate the help. thanks
ROn.
A step by step generation of rdlc as pdf and saving it on a given folder location is given in the foll post.
http://technoblab.blogspot.com
Do u want the rdlc itself to be generated and saved periodically w/o user intervention then ?
Then probablly I'll try ..
.......................................................................
Please "Mark As Answer" on the post that helped you.
|||
Hi,
Thanks. I need to automate the process. How to do that. Plz help.
thanks
|||Anyone who could help me here!!
|||hey,
Implement windows service which will run in the background and generate the report each interval time you specify in thetime ticker in the service app.config
to do this you can read the full example in this link http://en.csharp-online.net/Creating_a_.NET_Windows_Service%E2%80%94The_Timer_Approach
each time the timer method execute you call the reporting service web service and execute the report then stream the result and save it on your local server
sql
Monday, March 19, 2012
generating excel file automatically every morning
int the walkthrough, I find it a very interesting tool.
When viewing a report in IE, we have the possibility to export to excel
file. I woudl like to do a dynamic report, let's say generated on the fly at
6 o'clock morning and sent by mail as attachment. Is it possible with
reportin g services? if yes, any good articles or tutorials somewhere
Thanks for your help
What do you mean by dynamic?
You can schedule a report to run by using the Subscriptions "tab."
You can drop the report on a file share or you can email it.
By the way, you might want to address future questions related to Reporting
Services to the reporting services newsgroup
microsoft.public.sqlserver.reportingsvcs
Keith
"SalamElias" <eliassal@.online.nospam> wrote in message
news:59042B1C-ABC6-43D0-B0F7-BA82E442D298@.microsoft.com...
> Hi, I started playing with reporting services, followed the first 3
lessons
> int the walkthrough, I find it a very interesting tool.
> When viewing a report in IE, we have the possibility to export to excel
> file. I woudl like to do a dynamic report, let's say generated on the fly
at
> 6 o'clock morning and sent by mail as attachment. Is it possible with
> reportin g services? if yes, any good articles or tutorials somewhere
> Thanks for your help
|||By dynamic I mean, the report is executed for example 5 times, each time a
where clause containing a different value in order to generate 5 different
reports(I have to send an email for each provider with product I have sold
belonging to him)
In the doc on line, I saw we can generate we can have 2 datasets, the result
in the main table can be changed according to a parameter.
Thanks for your help. Next question I will post to it to the appropriate group
"Keith Kratochvil" wrote:
> What do you mean by dynamic?
> You can schedule a report to run by using the Subscriptions "tab."
> You can drop the report on a file share or you can email it.
> By the way, you might want to address future questions related to Reporting
> Services to the reporting services newsgroup
> microsoft.public.sqlserver.reportingsvcs
> --
> Keith
>
> "SalamElias" <eliassal@.online.nospam> wrote in message
> news:59042B1C-ABC6-43D0-B0F7-BA82E442D298@.microsoft.com...
> lessons
> at
>
|||If you have the Enterprise Edition of RS, use a data driven subscription for this.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"SalamElias" <eliassal@.online.nospam> wrote in message
news:44BA40B6-897F-4963-998B-9A5E137664A5@.microsoft.com...[vbcol=seagreen]
> By dynamic I mean, the report is executed for example 5 times, each time a
> where clause containing a different value in order to generate 5 different
> reports(I have to send an email for each provider with product I have sold
> belonging to him)
> In the doc on line, I saw we can generate we can have 2 datasets, the result
> in the main table can be changed according to a parameter.
> Thanks for your help. Next question I will post to it to the appropriate group
> "Keith Kratochvil" wrote:
Friday, March 9, 2012
Generate SQL scripts creating a separate file per object
Hello all,
What is an easy way of scripting all the database tables and sprocs automatically to a separate file each one? I can't find this option in SQL Server Management Studio.
Or is any other way of uploading all objects to a Visual Source Safe project that does not require to copy and paste each script into a VSS sql script?
Thanks!
David
Using SQL Server 2005, right click the database, choose Tasks-> Generate Scripts. You should see a new window open with an info screen. Click Next. Now you should be at the 'Select Database' screen. Select the database you want to generate scripts for, then check the "Script all objects in the selected database" checkbox. Click Next.
Now make sure your script options are correct. If you use the default properties for SQL Server setup, then default should be fine for this as well. Click Next after making any necessary changes.
Now you are at the "Output Option" screen. Select the "Script to file" radio button, and under "Files to generate", select the "File per object" option. Make sure you set your save location and encoding, if necessary.
At this point, you can either click Next to view a summary of what you just selected, or you can click Finish to start scripting. (There is also a "Finish" button on the summary screen.)
|||That "File per Object" option does not appear in my SQL Server Manager 2005.
I think I have installed the latest service pack.
|||
neutrino:
That "File per Object" option does not appear in my SQL Server Manager 2005.
I think I have installed the latest service pack.
I'm not sure if it has to do with the service pack. I have two computers that should both be updated to the latest SP. However, I was able to reproduce this problem with a machine running XP Pro, and the SQL Server Management Studio version was 9.00.1399.x.
The version this works on is 9.00.3042.x, and it is running on Server 2003.
Both computers only have the Development version installed, so maybe it has to do with being on a server OS?
Sunday, February 26, 2012
Generate report automaically and email them : Please help
My report takes a parameter say "name".
I want reports to be generated automatically for various values of
"name" and each of the generated report should be sent as email to the
person every month or so.
How do I go about achieving this? I am very new to reporting services
and I am stuck with very little documentation.
A detailed explanation or even a hint in the right direction would be
greatly appreciated.Use a data driven subscription. This will require setting up an additional
table to hold the values, but then there is a wizard to walk through in the
Report Manager to set this up. Take a look at the SQL-RS Books On Line to
get the details as it takes several steps to get it going.
Brian
"Aravind" <r.aravind@.gmail.com> wrote in message
news:1121867840.826151.118570@.o13g2000cwo.googlegroups.com...
> Please help me if possible.
> My report takes a parameter say "name".
> I want reports to be generated automatically for various values of
> "name" and each of the generated report should be sent as email to the
> person every month or so.
> How do I go about achieving this? I am very new to reporting services
> and I am stuck with very little documentation.
> A detailed explanation or even a hint in the right direction would be
> greatly appreciated.
>|||Yea, just make sure you have the enterprise edition of SQL server before you
start as it won't work in standard. The EE version is 10x the cost of
standard.
"goodman93" wrote:
> Use a data driven subscription. This will require setting up an additional
> table to hold the values, but then there is a wizard to walk through in the
> Report Manager to set this up. Take a look at the SQL-RS Books On Line to
> get the details as it takes several steps to get it going.
> Brian
> "Aravind" <r.aravind@.gmail.com> wrote in message
> news:1121867840.826151.118570@.o13g2000cwo.googlegroups.com...
> > Please help me if possible.
> >
> > My report takes a parameter say "name".
> > I want reports to be generated automatically for various values of
> > "name" and each of the generated report should be sent as email to the
> > person every month or so.
> >
> > How do I go about achieving this? I am very new to reporting services
> > and I am stuck with very little documentation.
> >
> > A detailed explanation or even a hint in the right direction would be
> > greatly appreciated.
> >
>
>
Sunday, February 19, 2012
generate a text file from SQL Server
Hi
I need to generate a text file from SQL Server. The task automatically runs daily.
The format of the text file use "/" to separate the field and the row. At the end of the file, it adds number of char and uses "\". The number of char includes the data parts and excludes a few word of "the number of char".
For example,
The underline fonts mean the first row record. The Bold fonts mean the second row record. The Italic fonts mean the third row record. The red fonts mean the number of char and the end of file.
1/060222/008888/234/1/7441/2/BB/10000//////290025/////1/060222/008888/234/1/7441/3/XX/100-//////290025/////1/060222/008881/234/1/7442/2/BB/10000//////290025/////161\
I am no idea about this problem. Please give me some suggestions. Thanks a lot
regards
Alex
For your information
I use SQL Server 2000 in Windows 2000 Server environments
Hi Alex,
You need to generate a Text File from SQL Server with field delimeter as "/" and the line delimeter as "/////"?
Also please let us know that whether you want to generate a Text file with static filename or it may vary?
Anyway I will also try to generate the file based on my understandings from your post.
Regards,
Prakash Srinivasan
|||Hi Prakash Srinivasan
The field delimeter is "/" and there is no line delimeter.
The task generates many files and place at different places where are the fixed folders. The filenames are static and need to override the old one.
Thank you for your help.
Alex
|||Hi Alex,
If you don't have any line delimeter (Row delimeter), then how would you differentiate the records. So there should be a row delimeter in the file to separate the records.
I assume there is and proceed further.
Regards,
Prakash Srinivasan
|||Hi Alex,
First create a Package and put a Data Flow. In the Data Flow, put one OleDb Source and Flat File Destination. Also create Connection for both OleDb Source and Flat File Destination.
And in the Flat File Connection Manager, specify the filename in which you want to dump the data, and leave the rest of the setting in General tab as it is.
In Advanced tab, create columns based on your requirement (Suppose if you need only 3 columns, create 3 columns and set the datatype based on the datatype specified in your SQL Server database).
In Columns tab, give the Row Delimeter as "////" and Column delimeter as "/".
Now connect your OleDb Source to the OleDb Connection manager and mention the tables which you want to access.
Now map the columns appropriately in the Flat File Destination and execute the package.
The results are coming exactly in my machine. And for writing the number of characters at the end of the file, put one Script Task and write a code to open the text file and read till the end of the file and write at the end of the file and add "\".
I hope there is a way to get this done in SSIS. If I get that, will let you know.
Regards,
Prakash Srinivasan.
|||One record followed by one record. The number of field are fixed in each row, so there are not the row delimeter.
for example,
record1field1/record1field2/record2field1/record2field2/55\
--Alex
|||Being new to this, how would you do it with a dynamically generated name? I need to generate a text file with the date as the filename and a key field from from a table daily. Thanks in advance!|||Miles Calunod wrote:
Being new to this, how would you do it with a dynamically generated name? I need to generate a text file with the date as the filename and a key field from from a table daily. Thanks in advance!
Miles,
Put an expression on the connection string property of the connection manager that you are using to point at the destination file. This expression will get evaluated at runtime and therefore can set the connection string (i.e. the file location) to be whatever you like.
-Jamie
generate a text file from SQL Server
Hi
I need to generate a text file from SQL Server. The task automatically runs daily.
The format of the text file use "/" to separate the field and the row. At the end of the file, it adds number of char and uses "\". The number of char includes the data parts and excludes a few word of "the number of char".
For example,
The underline fonts mean the first row record. The Bold fonts mean the second row record. The Italic fonts mean the third row record. The red fonts mean the number of char and the end of file.
1/060222/008888/234/1/7441/2/BB/10000//////290025/////1/060222/008888/234/1/7441/3/XX/100-//////290025/////1/060222/008881/234/1/7442/2/BB/10000//////290025/////161\
I am no idea about this problem. Please give me some suggestions. Thanks a lot
regards
Alex
For your information
I use SQL Server 2000 in Windows 2000 Server environments
Hi Alex,
You need to generate a Text File from SQL Server with field delimeter as "/" and the line delimeter as "/////"?
Also please let us know that whether you want to generate a Text file with static filename or it may vary?
Anyway I will also try to generate the file based on my understandings from your post.
Regards,
Prakash Srinivasan
|||Hi Prakash Srinivasan
The field delimeter is "/" and there is no line delimeter.
The task generates many files and place at different places where are the fixed folders. The filenames are static and need to override the old one.
Thank you for your help.
Alex
|||Hi Alex,
If you don't have any line delimeter (Row delimeter), then how would you differentiate the records. So there should be a row delimeter in the file to separate the records.
I assume there is and proceed further.
Regards,
Prakash Srinivasan
|||Hi Alex,
First create a Package and put a Data Flow. In the Data Flow, put one OleDb Source and Flat File Destination. Also create Connection for both OleDb Source and Flat File Destination.
And in the Flat File Connection Manager, specify the filename in which you want to dump the data, and leave the rest of the setting in General tab as it is.
In Advanced tab, create columns based on your requirement (Suppose if you need only 3 columns, create 3 columns and set the datatype based on the datatype specified in your SQL Server database).
In Columns tab, give the Row Delimeter as "////" and Column delimeter as "/".
Now connect your OleDb Source to the OleDb Connection manager and mention the tables which you want to access.
Now map the columns appropriately in the Flat File Destination and execute the package.
The results are coming exactly in my machine. And for writing the number of characters at the end of the file, put one Script Task and write a code to open the text file and read till the end of the file and write at the end of the file and add "\".
I hope there is a way to get this done in SSIS. If I get that, will let you know.
Regards,
Prakash Srinivasan.
|||One record followed by one record. The number of field are fixed in each row, so there are not the row delimeter.
for example,
record1field1/record1field2/record2field1/record2field2/55\
--Alex
|||Being new to this, how would you do it with a dynamically generated name? I need to generate a text file with the date as the filename and a key field from from a table daily. Thanks in advance!|||Miles Calunod wrote:
Being new to this, how would you do it with a dynamically generated name? I need to generate a text file with the date as the filename and a key field from from a table daily. Thanks in advance!
Miles,
Put an expression on the connection string property of the connection manager that you are using to point at the destination file. This expression will get evaluated at runtime and therefore can set the connection string (i.e. the file location) to be whatever you like.
-Jamie