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

Friday, March 30, 2012

Microsoft SQL Server 2005 beta - Database Dump


Hi, I would like to generate a database dump of my Microsoft SQL Server 2005 beta databases.

Does anyone know, how to do it?

Since I have many tables in one database, I would need the dump to include the schema as well as the data,

Thanks a lot for your help!

Use Backup/Restore method to get the Schema with data.

a. Backup Database YourDatabaseName To Disk='D:\Yourdb.bak'

b. RESTORE FILELISTONLY FROM DISK='D:\Yourdb.bak'

GO

c.

RESTORE DATABASE NewDBName

FROM DISK='D:\Database Backups\TTCProvidedData.BAK'

WITH MOVE'OldDatabaseDatafileLogicalName' TO 'D:\NewDBName.mdf',

MOVE OldDatabaseLogfileLogicalName' TO'D:\NewDBName_log.ldf'

change the path and db name accordingly.

Madhu

Monday, March 26, 2012

Microsoft OLE DB Provider for SQL Server"

I receive a "Cannot generate SSPI context" error message when you try to
connect to a SQL Server 2000 SP3 server computer.
According microsoft's article ID 843248 there is a hot fix. I do not want to
install SP2 just the hot fix.
Does anybody know the actual ID name of the hotfix. I am trying to connect
from XP SP1 Thank you
According to the article you referenced you could either download XP SP2 or
contact Product Support to get the fix.
In that article you can also find a workaround if you can not install either
SP2 or the fix.
I would recommend that you consider to install XP SP2 since it contains a
lot of security enhancements.
Simon
This posting is provided "as is" with no warranties and confers no rights.
"Yianni" <Yianni@.discussions.microsoft.com> wrote in message
news:B89BD7C7-E80B-48EE-943A-6832804665B5@.microsoft.com...
>I receive a "Cannot generate SSPI context" error message when you try to
> connect to a SQL Server 2000 SP3 server computer.
> According microsoft's article ID 843248 there is a hot fix. I do not want
> to
> install SP2 just the hot fix.
> Does anybody know the actual ID name of the hotfix. I am trying to connect
> from XP SP1 Thank you
>

Friday, March 23, 2012

Microsoft ODBC sql driver cannot generate sspi context

Hi,
I am facing a connection error occasionally. Im using MSDE2000a and
Dbamgr2k. The connection seems to have the following error
occasionally. Can anyone of u help me to troubleshoot this problem?
thank you.
Connection Failed
SQLState: 'HY000'
SQL Server Error: 1364
[Microsoft][ODBC SQL Server Driver]Cannot generate SSPI context
Regards,
JustinJustin wrote:
> Hi,
> I am facing a connection error occasionally. Im using MSDE2000a and
> Dbamgr2k. The connection seems to have the following error
> occasionally. Can anyone of u help me to troubleshoot this problem?
> thank you.
> Connection Failed
> SQLState: 'HY000'
> SQL Server Error: 1364
> [Microsoft][ODBC SQL Server Driver]Cannot generate SSPI context
> Regards,
> Justin
>
Are you connecting with a Windows account in a domain? If so, the machine r
unning SQL Server may have lost connection
to the domain controller and can't authenticate your account credentials. S
earch MS support.|||Thanx Ed Enstrom for your reply. I don't really get what you meant.
Maybe i should elaborate more on this. The pc is a standalone pc, OS is
xp pro, database using msde2000a. The error comes out from no where.
There are times which im able to connect to the sql server but
sometimes it shows the error of microsoft odbc sql server cannot
generate sspi context. Should i connect using the "sa" or by "trusted
NT connection" in dbamgr2k'
p/s: sorry, im a newbie here. thanx for your patience.
regards,
justin|||What Ed means by "Search MS support" is to search the MSDN and/or TechNet,
including the KB. I searched an old version of the MSDN for "Cannot generate
SSPI context" and got one result that says that the "native error will
contain the Win32 error code".
"Justin" <justin@.smsit.com.my> wrote in message
news:1135235596.227999.154030@.z14g2000cwz.googlegroups.com...
> Thanx Ed Enstrom for your reply. I don't really get what you meant.

Friday, March 9, 2012

Methods to generate ER diagrams programmatically

Hi All,

Can anyone tell me if its possible to generate ER diagrams programmatically using SQL Server.

Any help would be highly appreciated.

Thanks

-Akash

SQL Server Management Studio has a "Database Diagrams" option under Databases->[database] that may provide a useful visualization of a given SQL Server database.

Hope that helps,

John

Methods to generate ER diagrams programmatically

Hi All,

Can anyone tell me if its possible to generate ER diagrams programmatically using SQL Server.

Any help would be highly appreciated.

Thanks

-Akash

Hi Akash,

I worked on this a couple of years ago with SQL 2000. I wrote an application using Java, then started to rewrite it in VB.NET. I programmatically collected ER data from SQL Server and then used Graphviz to build the diagrams. It worked well, but I never finished it.

Chris

|||

Hi Chris,

Thanks for the immediate response, would be higly obliged if you would be able to demonstate the code for collecting the ER diagram from SQL Server.

-Akash

|||

Like I said, I didnt work all the bugs out, but what I was able to create was an input file for Graphviz. I created a tables collection and added one object for each table. then, each table object had a columns collection which contained one object for each column. I had some additional properties to denote PK and FK columns. I then used SQLDMO to iterate through the SQL Server database and populate my collections of objects. I then wrote a second procedure which built the input file for Graphviz.

Generally the code looks like this:

For each table

add an item to the tables collection

add a columns collection to the table

add each table column to the columns collection

next column

next table

I'll try to post an output from Graphviz if you are interested.

Chris

|||

Hi Akash,

I found my code and checked it out. Currently, it works against both SQL 2000 and SQL 2005. I pointed it to the AdventureWorks sample database on a SQL 2005 box and it worked. If you will give me your email address I will send you the generated JPG output file.

|||

Hi Chris,

It would be really helpful. Do send it on lionhearted.prince@.gmail.com

Thanks

-Akash

|||

Hi Akash,

Was that output file what you were looking for?

|||

Hi Chris,

It was really great to see the output file, but that wasn't what exactly i needed. I need to generate ER diagrams programmatically using SQL Server without using a third party tool.

If you have any pointers to get it done, do share it.

Thanks

-Akash

Methods to generate ER diagrams programmatically

Hi All,

Can anyone tell me if its possible to generate ER diagrams programmatically using SQL Server.

Any help would be highly appreciated.

Thanks

-Akash

Hi Akash,

I worked on this a couple of years ago with SQL 2000. I wrote an application using Java, then started to rewrite it in VB.NET. I programmatically collected ER data from SQL Server and then used Graphviz to build the diagrams. It worked well, but I never finished it.

Chris

|||

Hi Chris,

Thanks for the immediate response, would be higly obliged if you would be able to demonstate the code for collecting the ER diagram from SQL Server.

-Akash

|||

Like I said, I didnt work all the bugs out, but what I was able to create was an input file for Graphviz. I created a tables collection and added one object for each table. then, each table object had a columns collection which contained one object for each column. I had some additional properties to denote PK and FK columns. I then used SQLDMO to iterate through the SQL Server database and populate my collections of objects. I then wrote a second procedure which built the input file for Graphviz.

Generally the code looks like this:

For each table

add an item to the tables collection

add a columns collection to the table

add each table column to the columns collection

next column

next table

I'll try to post an output from Graphviz if you are interested.

Chris

|||

Hi Akash,

I found my code and checked it out. Currently, it works against both SQL 2000 and SQL 2005. I pointed it to the AdventureWorks sample database on a SQL 2005 box and it worked. If you will give me your email address I will send you the generated JPG output file.

|||

Hi Chris,

It would be really helpful. Do send it on lionhearted.prince@.gmail.com

Thanks

-Akash

|||

Hi Akash,

Was that output file what you were looking for?

|||

Hi Chris,

It was really great to see the output file, but that wasn't what exactly i needed. I need to generate ER diagrams programmatically using SQL Server without using a third party tool.

If you have any pointers to get it done, do share it.

Thanks

-Akash

Methods to generate ER diagrams programmatically

Hi All,

Can anyone tell me if its possible to generate ER diagrams programmatically using SQL Server.

Any help would be highly appreciated.

Thanks

-Akash

Hi Akash,

I worked on this a couple of years ago with SQL 2000. I wrote an application using Java, then started to rewrite it in VB.NET. I programmatically collected ER data from SQL Server and then used Graphviz to build the diagrams. It worked well, but I never finished it.

Chris

|||

Hi Chris,

Thanks for the immediate response, would be higly obliged if you would be able to demonstate the code for collecting the ER diagram from SQL Server.

-Akash

|||

Like I said, I didnt work all the bugs out, but what I was able to create was an input file for Graphviz. I created a tables collection and added one object for each table. then, each table object had a columns collection which contained one object for each column. I had some additional properties to denote PK and FK columns. I then used SQLDMO to iterate through the SQL Server database and populate my collections of objects. I then wrote a second procedure which built the input file for Graphviz.

Generally the code looks like this:

For each table

add an item to the tables collection

add a columns collection to the table

add each table column to the columns collection

next column

next table

I'll try to post an output from Graphviz if you are interested.

Chris

|||

Hi Akash,

I found my code and checked it out. Currently, it works against both SQL 2000 and SQL 2005. I pointed it to the AdventureWorks sample database on a SQL 2005 box and it worked. If you will give me your email address I will send you the generated JPG output file.

|||

Hi Chris,

It would be really helpful. Do send it on lionhearted.prince@.gmail.com

Thanks

-Akash

|||

Hi Akash,

Was that output file what you were looking for?

|||

Hi Chris,

It was really great to see the output file, but that wasn't what exactly i needed. I need to generate ER diagrams programmatically using SQL Server without using a third party tool.

If you have any pointers to get it done, do share it.

Thanks

-Akash

Wednesday, March 7, 2012

Metadata in sql server 2005

Hi
I add extended properties to table in sql server 2005, for example i add Caption property to every column.
In case I generate a datasource from table in sql server in visual studio 2005, Is there a way that "Caption" property in datatable to be filled from that metadata, or metadata is useless for dataset.
Every time i had to fill manually the caption property of datatable generated .

hi,

you can access those extended properties calling fn_listextendedproperty function, similar to

SET NOCOUNT ON; USE tempdb; GO CREATE TABLE dbo.Invoice ( ID INT NOT NULL PRIMARY KEY , BillNo INT NOT NULL -- , others ) GO EXEC sp_addextendedproperty '1st property' , '1St property value' , 'user' , 'dbo' , 'table' , 'Invoice' , NULL , NULL; EXEC sp_addextendedproperty '2nd property' , '2nd property value' , 'user' , 'dbo' , 'table' , 'Invoice' , NULL , NULL; GO PRINT 'All available properties'; SELECT CONVERT(VARCHAR(20), [name]) AS [Property Name] , CONVERT(VARCHAR(20), [value]) AS [Property vCharValue] FROM ::fn_listextendedproperty( NULL , 'user' , 'dbo' , 'table' , 'Invoice' , NULL , NULL ); GO PRINT 'just the required [1st property] property'; SELECT CONVERT(VARCHAR(20), [name]) AS [Property Name] , convert(VARCHAR(20),[value]) AS [Property vCharValue] FROM ::fn_listextendedproperty( '1st property' , 'user' , 'dbo' , 'table' , 'Invoice' , NULL , NULL ); GO DROP TABLE dbo.Invoice; --< All available properties Property Name Property vCharValue -- -- 1st property 1St property value 2nd property 2nd property value just the required [1st property] property Property Name Property vCharValue -- -- 1st property 1St property value

so, assuming you are interested in the Invoice management, you have to query for all the properties of the dbo.Invoice table columns...

this can obviously fill a dataset or a datareader you can then consume to map as desired the returned values so you could assume the "1st property" is the caption of the corresponding UI control and you can set it accordingly..

BTW, to manage those properties outside the Microsoft tools you have to resort on http://msdn2.microsoft.com/en-us/library/aa174648(SQL.80).aspx and http://msdn2.microsoft.com/en-us/library/ms190243.aspx

regards|||Thank you for your reply.
I mean , what is the extended properties that may be used automatically by visual studio 2005.
For example , Can the "Caption " property of datatable created in vs 2005 , be set automatically using extended properties?
This property is useful, because form wizard creates label with that "caption" value(when i set it at design time), and textbox bound to column.

|||

hi,

no, you have to deal with that "by hand"...

regards

Metadata Definition ?

Hello, i would like to know if it's possible to generate automatically a word document or an excel document that will contain all the metadata definition, for example containing the source columns names, their datatype, and the destination with their datatypes, so that it would easy to create a data dictionnary .

Thank you in advance.

Microsoft have talked about a tool called "SQL Dcoumenter" that will do this. No news about when it will be released though.

-Jamie

|||Thank you for your answer, i will do that manually.

Messed up with reporting services

Hi, I'm developing a Web application in which the user, after a certain operation, it will generate a report using reporting services. The doubt is:

How do I generate the report?Is there any report on the web app that I give parameters and then show it, or is there a report on the web server and I send him the parameters?These parameters come from a specific data set or can come from a arraylist ore something from the web app?

Which of the two perspectives is the best?I've looked im Microsoft but this aspect is not very explicit, I'm having serious doubts about how to do this, its kinda complicated one I'm brand new on SSRS!Thanks a lot!!

With reporting services you can access reports 2 ways (thatI know of)

URL access, using this method your eb app will build up a url for eg,http://reportServerName//reportserver/reportdirectory/reportname.rdl

to pass parameters, you can add &Parameter1Name=1&ParameterName2=2 etc

you can also build up your url to hide/show toolbars, select output formats, etc

Web service, basically the above but programatically

If you have them check out Reporting Services BOL looks of good info there