Showing posts with label mssql. Show all posts
Showing posts with label mssql. Show all posts

Thursday, March 29, 2012

describe table

Oracle has describe table, which will return the SQL Definition of that tabl
e...what is the equivalent in MSSQL? I am aware of sp_help table, but that d
oesn't cut it.
I want to create a table using one of the various GUI tools that are "out th
ere" but I then want to save the resulting SQL DDL, so that I can script fut
ure database creates/drops/etc.
Any help appreciated.
BOBBoth Query Analyzer and Enterprise Manager can script DDL from an existing
objects. EM also allows you to save DDL scripts when creating or modifying
objects via the 'save change script' button.
Hope this helps.
Dan Guzman
SQL Server MVP
"bob" <bob@.discussions.microsoft.com> wrote in message
news:BA0FCA03-FD78-4845-9655-00CE08A5B290@.microsoft.com...
> Oracle has describe table, which will return the SQL Definition of that
table...what is the equivalent in MSSQL? I am aware of sp_help table, but
that doesn't cut it.
> I want to create a table using one of the various GUI tools that are "out
there" but I then want to save the resulting SQL DDL, so that I can script
future database creates/drops/etc.
> Any help appreciated.
> BOB|||If you use Enterprise Manager (one of those various GUI tools ;-)) you can
generate a create table script with the third button from the left.
Jacco Schalkwijk
SQL Server MVP
"bob" <bob@.discussions.microsoft.com> wrote in message
news:BA0FCA03-FD78-4845-9655-00CE08A5B290@.microsoft.com...
> Oracle has describe table, which will return the SQL Definition of that
table...what is the equivalent in MSSQL? I am aware of sp_help table, but
that doesn't cut it.
> I want to create a table using one of the various GUI tools that are "out
there" but I then want to save the resulting SQL DDL, so that I can script
future database creates/drops/etc.
> Any help appreciated.
> BOB|||Query Analyzer will script any table individually. Just right-click on the
table in the Object Browser and select Script to New Window As > Create.
Enterprise Manager will allow you to script multiple objects to a single
file or script an entire database if you wish.
David Portas
SQL Server MVP
--|||Thanks...I was hoping for a non EM solution...a simple bit of SQL (actually,
I am using MSDE, so EM is not an option...)
Cheers,
BOB
"Jacco Schalkwijk" wrote:

> If you use Enterprise Manager (one of those various GUI tools ;-)) you can
> generate a create table script with the third button from the left.
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "bob" <bob@.discussions.microsoft.com> wrote in message
> news:BA0FCA03-FD78-4845-9655-00CE08A5B290@.microsoft.com...
> table...what is the equivalent in MSSQL? I am aware of sp_help table, but
> that doesn't cut it.
> there" but I then want to save the resulting SQL DDL, so that I can script
> future database creates/drops/etc.
>
>|||Bob,
There's no TSQL out-of-the-box option to get the CREATE TABLE statement for
an existing table. There are bunch
of options, both GUI, client code and TSQL code, however. You might want to
start at:
http://www.karaszi.com/sqlserver/in...rate_script.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"bob" <bob@.discussions.microsoft.com> wrote in message
news:A51ADE49-037D-4CD6-85AB-E169CB524DAF@.microsoft.com...
> Thanks...I was hoping for a non EM solution...a simple bit of SQL (actually, I am
using MSDE, so EM is not
an option...)[vbcol=seagreen]
> Cheers,
> BOB
> "Jacco Schalkwijk" wrote:
>|||One of the ten commandments at our shop is to SCRIPT EVERYTHING.
That means we make a TEXT file with an extension of .SQL and put our TABLE c
reate right in there. We building indexes and constraints right in that scr
ipt. We have control over naming our indexes.
We script STORED PROCEDURE creation. We script the GRANTing of rights to SP
ROCS in the same script.
Changes made in the GUI can get lost and never make it to production servers
.
Having EM or QA create a script from the database is flawed - it doesn't hav
e everything associated with that table or sproc...
At least that's the way we do it - and it's been very successful in a rapid
development/get the software to the customer scenario over the past 3 years.
"David Portas" wrote:

> Query Analyzer will script any table individually. Just right-click on the
> table in the Object Browser and select Script to New Window As > Create.
> Enterprise Manager will allow you to script multiple objects to a single
> file or script an entire database if you wish.
> --
> David Portas
> SQL Server MVP
> --
>
>sql

describe table

Oracle has describe table, which will return the SQL Definition of that table...what is the equivalent in MSSQL? I am aware of sp_help table, but that doesn't cut it.
I want to create a table using one of the various GUI tools that are "out there" but I then want to save the resulting SQL DDL, so that I can script future database creates/drops/etc.
Any help appreciated.
BOB
Both Query Analyzer and Enterprise Manager can script DDL from an existing
objects. EM also allows you to save DDL scripts when creating or modifying
objects via the 'save change script' button.
Hope this helps.
Dan Guzman
SQL Server MVP
"bob" <bob@.discussions.microsoft.com> wrote in message
news:BA0FCA03-FD78-4845-9655-00CE08A5B290@.microsoft.com...
> Oracle has describe table, which will return the SQL Definition of that
table...what is the equivalent in MSSQL? I am aware of sp_help table, but
that doesn't cut it.
> I want to create a table using one of the various GUI tools that are "out
there" but I then want to save the resulting SQL DDL, so that I can script
future database creates/drops/etc.
> Any help appreciated.
> BOB
|||If you use Enterprise Manager (one of those various GUI tools ;-)) you can
generate a create table script with the third button from the left.
Jacco Schalkwijk
SQL Server MVP
"bob" <bob@.discussions.microsoft.com> wrote in message
news:BA0FCA03-FD78-4845-9655-00CE08A5B290@.microsoft.com...
> Oracle has describe table, which will return the SQL Definition of that
table...what is the equivalent in MSSQL? I am aware of sp_help table, but
that doesn't cut it.
> I want to create a table using one of the various GUI tools that are "out
there" but I then want to save the resulting SQL DDL, so that I can script
future database creates/drops/etc.
> Any help appreciated.
> BOB
|||Query Analyzer will script any table individually. Just right-click on the
table in the Object Browser and select Script to New Window As > Create.
Enterprise Manager will allow you to script multiple objects to a single
file or script an entire database if you wish.
David Portas
SQL Server MVP
|||Thanks...I was hoping for a non EM solution...a simple bit of SQL (actually, I am using MSDE, so EM is not an option...)
Cheers,
BOB
"Jacco Schalkwijk" wrote:

> If you use Enterprise Manager (one of those various GUI tools ;-)) you can
> generate a create table script with the third button from the left.
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "bob" <bob@.discussions.microsoft.com> wrote in message
> news:BA0FCA03-FD78-4845-9655-00CE08A5B290@.microsoft.com...
> table...what is the equivalent in MSSQL? I am aware of sp_help table, but
> that doesn't cut it.
> there" but I then want to save the resulting SQL DDL, so that I can script
> future database creates/drops/etc.
>
>
|||Bob,
There's no TSQL out-of-the-box option to get the CREATE TABLE statement for an existing table. There are bunch
of options, both GUI, client code and TSQL code, however. You might want to start at:
http://www.karaszi.com/sqlserver/inf...ate_script.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"bob" <bob@.discussions.microsoft.com> wrote in message
news:A51ADE49-037D-4CD6-85AB-E169CB524DAF@.microsoft.com...
> Thanks...I was hoping for a non EM solution...a simple bit of SQL (actually, I am using MSDE, so EM is not
an option...)[vbcol=seagreen]
> Cheers,
> BOB
> "Jacco Schalkwijk" wrote:
|||One of the ten commandments at our shop is to SCRIPT EVERYTHING.
That means we make a TEXT file with an extension of .SQL and put our TABLE create right in there. We building indexes and constraints right in that script. We have control over naming our indexes.
We script STORED PROCEDURE creation. We script the GRANTing of rights to SPROCS in the same script.
Changes made in the GUI can get lost and never make it to production servers.
Having EM or QA create a script from the database is flawed - it doesn't have everything associated with that table or sproc...
At least that's the way we do it - and it's been very successful in a rapid development/get the software to the customer scenario over the past 3 years.
"David Portas" wrote:

> Query Analyzer will script any table individually. Just right-click on the
> table in the Object Browser and select Script to New Window As > Create.
> Enterprise Manager will allow you to script multiple objects to a single
> file or script an entire database if you wish.
> --
> David Portas
> SQL Server MVP
> --
>
>

describe table

Oracle has describe table, which will return the SQL Definition of that table...what is the equivalent in MSSQL? I am aware of sp_help table, but that doesn't cut it.
I want to create a table using one of the various GUI tools that are "out there" but I then want to save the resulting SQL DDL, so that I can script future database creates/drops/etc.
Any help appreciated.
BOBBoth Query Analyzer and Enterprise Manager can script DDL from an existing
objects. EM also allows you to save DDL scripts when creating or modifying
objects via the 'save change script' button.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"bob" <bob@.discussions.microsoft.com> wrote in message
news:BA0FCA03-FD78-4845-9655-00CE08A5B290@.microsoft.com...
> Oracle has describe table, which will return the SQL Definition of that
table...what is the equivalent in MSSQL? I am aware of sp_help table, but
that doesn't cut it.
> I want to create a table using one of the various GUI tools that are "out
there" but I then want to save the resulting SQL DDL, so that I can script
future database creates/drops/etc.
> Any help appreciated.
> BOB|||If you use Enterprise Manager (one of those various GUI tools ;-)) you can
generate a create table script with the third button from the left.
--
Jacco Schalkwijk
SQL Server MVP
"bob" <bob@.discussions.microsoft.com> wrote in message
news:BA0FCA03-FD78-4845-9655-00CE08A5B290@.microsoft.com...
> Oracle has describe table, which will return the SQL Definition of that
table...what is the equivalent in MSSQL? I am aware of sp_help table, but
that doesn't cut it.
> I want to create a table using one of the various GUI tools that are "out
there" but I then want to save the resulting SQL DDL, so that I can script
future database creates/drops/etc.
> Any help appreciated.
> BOB|||Query Analyzer will script any table individually. Just right-click on the
table in the Object Browser and select Script to New Window As > Create.
Enterprise Manager will allow you to script multiple objects to a single
file or script an entire database if you wish.
--
David Portas
SQL Server MVP
--|||Thanks...I was hoping for a non EM solution...a simple bit of SQL (actually, I am using MSDE, so EM is not an option...)
Cheers,
BOB
"Jacco Schalkwijk" wrote:
> If you use Enterprise Manager (one of those various GUI tools ;-)) you can
> generate a create table script with the third button from the left.
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "bob" <bob@.discussions.microsoft.com> wrote in message
> news:BA0FCA03-FD78-4845-9655-00CE08A5B290@.microsoft.com...
> > Oracle has describe table, which will return the SQL Definition of that
> table...what is the equivalent in MSSQL? I am aware of sp_help table, but
> that doesn't cut it.
> >
> > I want to create a table using one of the various GUI tools that are "out
> there" but I then want to save the resulting SQL DDL, so that I can script
> future database creates/drops/etc.
> >
> > Any help appreciated.
> >
> > BOB
>
>|||Bob,
There's no TSQL out-of-the-box option to get the CREATE TABLE statement for an existing table. There are bunch
of options, both GUI, client code and TSQL code, however. You might want to start at:
http://www.karaszi.com/sqlserver/info_generate_script.asp
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"bob" <bob@.discussions.microsoft.com> wrote in message
news:A51ADE49-037D-4CD6-85AB-E169CB524DAF@.microsoft.com...
> Thanks...I was hoping for a non EM solution...a simple bit of SQL (actually, I am using MSDE, so EM is not
an option...)
> Cheers,
> BOB
> "Jacco Schalkwijk" wrote:
> > If you use Enterprise Manager (one of those various GUI tools ;-)) you can
> > generate a create table script with the third button from the left.
> >
> > --
> > Jacco Schalkwijk
> > SQL Server MVP
> >
> >
> > "bob" <bob@.discussions.microsoft.com> wrote in message
> > news:BA0FCA03-FD78-4845-9655-00CE08A5B290@.microsoft.com...
> > > Oracle has describe table, which will return the SQL Definition of that
> > table...what is the equivalent in MSSQL? I am aware of sp_help table, but
> > that doesn't cut it.
> > >
> > > I want to create a table using one of the various GUI tools that are "out
> > there" but I then want to save the resulting SQL DDL, so that I can script
> > future database creates/drops/etc.
> > >
> > > Any help appreciated.
> > >
> > > BOB
> >
> >
> >|||if you want full database change management for SQL
Server check out www.dbghost.com. They also give away a
free scripting utility which scripts out data and schema.
>--Original Message--
>Oracle has describe table, which will return the SQL
Definition of that table...what is the equivalent in
MSSQL? I am aware of sp_help table, but that doesn't cut
it.
>I want to create a table using one of the various GUI
tools that are "out there" but I then want to save the
resulting SQL DDL, so that I can script future database
creates/drops/etc.
>Any help appreciated.
>BOB
>.
>

Sunday, March 11, 2012

Deploying RS server components on server without MSSQL

For the application I need to integrate RS with, I have a physical server
running MSSQL 2000 SP3a Standard Edition and another physical server that
runs my web apps. Both servers are running windows 2000 SP2. We do not want
to install RS server components on the db server itself because we want it to
remain a dedicated database server.
So, we want to host the Report Server database on the db physical server and
run all of the RS server components on the application physical server.
Yet when I try to install RS on my application server, I get the following
message in the install 'System Prerequisite Check': 'This edition of
Reporting Services does not support installing the server components on this
operating system'. What does this mean? How can I get around it?
-kind regards, Brian ParkerThe issue is not the database. RS is designed to run this way (note that you
need to have another SQL Server license if RS is on another server than
where the DB resides but that is a licensing issue). The issue is the OS.
Here is a link on the prereqs:
http://www.microsoft.com/sql/reporting/productinfo/sysreqs.asp
a.. Windows® 2000 Server with Service Pack 4 (SP4) or later
a.. Windows 2000 Professional with SP4 or later1
I wasn't sure if you had server or professional. If server then it needs
SP4. If professional then this additional info holds:
Windows XP Professional and Windows 2000 Professional only support Reporting
Services Developer Edition
So, one of those two things is what is happening.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Brian Parker" <BrianParker@.discussions.microsoft.com> wrote in message
news:97ECE792-B9F0-4762-A278-1BC8790797A0@.microsoft.com...
> For the application I need to integrate RS with, I have a physical server
> running MSSQL 2000 SP3a Standard Edition and another physical server that
> runs my web apps. Both servers are running windows 2000 SP2. We do not
> want
> to install RS server components on the db server itself because we want it
> to
> remain a dedicated database server.
> So, we want to host the Report Server database on the db physical server
> and
> run all of the RS server components on the application physical server.
> Yet when I try to install RS on my application server, I get the following
> message in the install 'System Prerequisite Check': 'This edition of
> Reporting Services does not support installing the server components on
> this
> operating system'. What does this mean? How can I get around it?
> -kind regards, Brian Parker

deploying reports from vs2005 issue

I'm trying to deploy reports to development server that is running
mssql 2000 and a named instance of mssql 2005 but when I deploy I'm
running into authentication issues. From some articles I'm finding
that this can occur when using SSRS in mssql2000. Do I need to modify
the deployment path in visual studio to some how point to the named
mssql 2005 database, if so how? Also where do I find the
configuration in vs2005 to not overwrite the datasources when a report
is deployed?
Thanks,
JeffWhen you setup for deployment you give it the web address. If your report
server is working that is all you should need to do. For instance it would
look like this for TargetServerURL: http://yourserver/ReportServer
Now, to be able to deploy you need to have the rights to do so. This is
Reporting Services rights. It has nothing to do with SQL Server DB rights.
Can you run reports? First make sure of that.
If your domain account is in the local administrators group on the server
then you will automatically have all the rights you need. Again, this is
around your windows account, not your SQL Server access rights.
Also, the default in vs2005 is to NOT overwrite a datasource. Right mouse
click on the project, properties. This is where you set the targetserverurl
and also the overwritedatasources (which you want to be false).
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Jeffa" <Jeff.Arlt@.gmail.com> wrote in message
news:1183479523.437839.111440@.j4g2000prf.googlegroups.com...
> I'm trying to deploy reports to development server that is running
> mssql 2000 and a named instance of mssql 2005 but when I deploy I'm
> running into authentication issues. From some articles I'm finding
> that this can occur when using SSRS in mssql2000. Do I need to modify
> the deployment path in visual studio to some how point to the named
> mssql 2005 database, if so how? Also where do I find the
> configuration in vs2005 to not overwrite the datasources when a report
> is deployed?
> Thanks,
> Jeff
>

Friday, March 9, 2012

Deploying MSSQL 2005 Express DB to MSSQL 2005 WKGP Errors

DB is developed on local computer with MSSQL 2005 Express. My host is on MSSQL 2005 workgroup. Are they compatible, because I am getting errors? Is my approach wrong?

I have tried several approaches.

A) I created a backup of database on my local, then placed a copy on the server. Then I tried to restore through Server Management Studio. I get this error.

TITLE: Microsoft SQL Server Management Studio

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

ADDITIONAL INFORMATION:

The backed-up database has on-disk structure version 611. The server supports version 539 and cannot restore or upgrade this database.

RESTORE FILELIST is terminating abnormally. (Microsoft SQL Server, Error: 3169)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=08.00.2039&EvtSrc=MSSQLServer&EvtID=3169&LinkId=20476

BUTTONS:

OK

B: I also have tried copying the database. I put it in the same path as the other databases that can be read with server management studio on the server. Then, tried to get to it through server managements studio and it did not appear. So I tried to attach it. Then I received this error:

TITLE: Microsoft SQL Server Management Studio

Attach database failed for Server 'MROACH1'. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476

ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

Could not find row in sysindexes for database ID 10, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.

Could not open new database 'LodgingDB'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 602)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=602&LinkId=20476

BUTTONS:

OK

C: I have also tried opening the Database, and back up file through Server Management Studio. without success.

D: I also tried Windows and Software update at microsoft update, but no updates were recommended for Version on Server.

I'm surprised this is so hard. My original data base was created in same family of software. 2005 MS SQL Express. I could use some direct help from someone experienced with this. Am I doing it wrong or are the DB versions incompatible.

Mark Roach

Hi Mark,

The first error you mention would indicate that your hosting company is using SQL 2000 not SQL 2005. Database files are not backward compatible. You should verify with your host what version of SQL Server they have, or if they have both 2000 and 2005, that they are pointing you to a 2005 server.

Mike

|||

Thanks Mike,

The host machine is on MSSQL 2005 WorkGroup.

|||

Actually, you may be incorrect about what is running on the hosting system.

The error message from the restore:

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=08.00.2039&EvtSrc=MSSQLServer&EvtID=3169&LinkId=20476

indicates (ProdVer=08.00.2039) that it is running SQL 2000, not SQL 2005. Also, the error message talking about versions of databases indicates the same.

All SKUs/editions of SQL databases of the same version are compatible. There are no diffences in database format between Express and Workgroup as long as both are the same version.

|||

Hi there,

I got the same error when I tried to restore the SQL 2005 DB to SQL 2005 DB.

Were you able to figure this one out? If so, could you please let me know?

Thanks in advance,

SG.

Deploying MSSQL 2005 Express DB to MSSQL 2005 WKGP Errors

DB is developed on local computer with MSSQL 2005 Express. My host is on MSSQL 2005 workgroup. Are they compatible, because I am getting errors? Is my approach wrong?

I have tried several approaches.

A) I created a backup of database on my local, then placed a copy on the server. Then I tried to restore through Server Management Studio. I get this error.

TITLE: Microsoft SQL Server Management Studio

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

ADDITIONAL INFORMATION:

The backed-up database has on-disk structure version 611. The server supports version 539 and cannot restore or upgrade this database.

RESTORE FILELIST is terminating abnormally. (Microsoft SQL Server, Error: 3169)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=08.00.2039&EvtSrc=MSSQLServer&EvtID=3169&LinkId=20476

BUTTONS:

OK

B: I also have tried copying the database. I put it in the same path as the other databases that can be read with server management studio on the server. Then, tried to get to it through server managements studio and it did not appear. So I tried to attach it. Then I received this error:

TITLE: Microsoft SQL Server Management Studio

Attach database failed for Server 'MROACH1'. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476

ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

Could not find row in sysindexes for database ID 10, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.

Could not open new database 'LodgingDB'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 602)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=602&LinkId=20476

BUTTONS:

OK

C: I have also tried opening the Database, and back up file through Server Management Studio. without success.

D: I also tried Windows and Software update at microsoft update, but no updates were recommended for Version on Server.

I'm surprised this is so hard. My original data base was created in same family of software. 2005 MS SQL Express. I could use some direct help from someone experienced with this. Am I doing it wrong or are the DB versions incompatible.

Mark Roach

Hi Mark,

The first error you mention would indicate that your hosting company is using SQL 2000 not SQL 2005. Database files are not backward compatible. You should verify with your host what version of SQL Server they have, or if they have both 2000 and 2005, that they are pointing you to a 2005 server.

Mike

|||

Thanks Mike,

The host machine is on MSSQL 2005 WorkGroup.

|||

Actually, you may be incorrect about what is running on the hosting system.

The error message from the restore:

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=08.00.2039&EvtSrc=MSSQLServer&EvtID=3169&LinkId=20476

indicates (ProdVer=08.00.2039) that it is running SQL 2000, not SQL 2005. Also, the error message talking about versions of databases indicates the same.

All SKUs/editions of SQL databases of the same version are compatible. There are no diffences in database format between Express and Workgroup as long as both are the same version.

|||

Hi there,

I got the same error when I tried to restore the SQL 2005 DB to SQL 2005 DB.

Were you able to figure this one out? If so, could you please let me know?

Thanks in advance,

SG.