Showing posts with label express. Show all posts
Showing posts with label express. Show all posts

Friday, March 30, 2012

How do I move a database I have developed on my local server (2005) to my client?

Hi all. Probably a simple thing to do but I need to know how to do this. I
have to move the database I created in 2005 Enterprise to 2005 Express on my
client site. Do I just do a back up and burn to a CD and after installing
2005 Express restore the backup? Don't I need the .mdf and the .ldf files
or does the backup procedure in the Studio backup both? I set it to backup
the Database.
Regards,
RobertYou can A) drop the database, copy the mdf and ldf files to CD or
somewhere that you can move them and at the client site attach them or
b) do a backup of the database and restore at the client site. Did you
use any Enterprise features that Express may not support?
Robert Johnson wrote:
> Hi all. Probably a simple thing to do but I need to know how to do this. I
> have to move the database I created in 2005 Enterprise to 2005 Express on my
> client site. Do I just do a back up and burn to a CD and after installing
> 2005 Express restore the backup? Don't I need the .mdf and the .ldf files
> or does the backup procedure in the Studio backup both? I set it to backup
> the Database.
> Regards,
> Robert
>|||I don't believe so.. Just added tables and one view. No triggers, functions
or stuff like that. Relationships between tables and constraints are in
place. The client has less than 5 concurent users so Express should work
fine for him. It's a very small client and small database needs.
Interesting idea about detaching and copy the mdf and ldf to CD. Didn't
think that would work. I'll give that a shot.
Regards and Thanks
Robert
"Brett I. Holcomb" <brettholcomb@.bellsouth.net> wrote in message
news:unSxUqUBIHA.3780@.TK2MSFTNGP05.phx.gbl...
> You can A) drop the database, copy the mdf and ldf files to CD or
> somewhere that you can move them and at the client site attach them or b)
> do a backup of the database and restore at the client site. Did you use
> any Enterprise features that Express may not support?
>
> Robert Johnson wrote:
>> Hi all. Probably a simple thing to do but I need to know how to do this.
>> I have to move the database I created in 2005 Enterprise to 2005 Express
>> on my client site. Do I just do a back up and burn to a CD and after
>> installing 2005 Express restore the backup? Don't I need the .mdf and
>> the .ldf files or does the backup procedure in the Studio backup both? I
>> set it to backup the Database.
>> Regards,
>> Robert|||I had to ask <G>. I use the attach/detach all the time. After I've
copied the ldf and mdf I reattach to the original db. That's how I move
from our test to production server.
Robert Johnson wrote:
> I don't believe so.. Just added tables and one view. No triggers, functions
> or stuff like that. Relationships between tables and constraints are in
> place. The client has less than 5 concurent users so Express should work
> fine for him. It's a very small client and small database needs.
> Interesting idea about detaching and copy the mdf and ldf to CD. Didn't
> think that would work. I'll give that a shot.
> Regards and Thanks
> Robert
> "Brett I. Holcomb" <brettholcomb@.bellsouth.net> wrote in message
> news:unSxUqUBIHA.3780@.TK2MSFTNGP05.phx.gbl...
>> You can A) drop the database, copy the mdf and ldf files to CD or
>> somewhere that you can move them and at the client site attach them or b)
>> do a backup of the database and restore at the client site. Did you use
>> any Enterprise features that Express may not support?
>>
>> Robert Johnson wrote:
>> Hi all. Probably a simple thing to do but I need to know how to do this.
>> I have to move the database I created in 2005 Enterprise to 2005 Express
>> on my client site. Do I just do a back up and burn to a CD and after
>> installing 2005 Express restore the backup? Don't I need the .mdf and
>> the .ldf files or does the backup procedure in the Studio backup both? I
>> set it to backup the Database.
>> Regards,
>> Robert
>|||Thanks again Brett. I'll test it out tomorrow on site. If your ears are
burning...lol.
Robert
"Brett I. Holcomb" <brettholcomb@.bellsouth.net> wrote in message
news:eKtpB4UBIHA.4836@.TK2MSFTNGP06.phx.gbl...
>I had to ask <G>. I use the attach/detach all the time. After I've copied
>the ldf and mdf I reattach to the original db. That's how I move from our
>test to production server.
> Robert Johnson wrote:
>> I don't believe so.. Just added tables and one view. No triggers,
>> functions or stuff like that. Relationships between tables and
>> constraints are in place. The client has less than 5 concurent users so
>> Express should work fine for him. It's a very small client and small
>> database needs. Interesting idea about detaching and copy the mdf and ldf
>> to CD. Didn't think that would work. I'll give that a shot.
>> Regards and Thanks
>> Robert
>> "Brett I. Holcomb" <brettholcomb@.bellsouth.net> wrote in message
>> news:unSxUqUBIHA.3780@.TK2MSFTNGP05.phx.gbl...
>> You can A) drop the database, copy the mdf and ldf files to CD or
>> somewhere that you can move them and at the client site attach them or
>> b) do a backup of the database and restore at the client site. Did you
>> use any Enterprise features that Express may not support?
>>
>> Robert Johnson wrote:
>> Hi all. Probably a simple thing to do but I need to know how to do
>> this. I have to move the database I created in 2005 Enterprise to 2005
>> Express on my client site. Do I just do a back up and burn to a CD and
>> after installing 2005 Express restore the backup? Don't I need the
>> .mdf and the .ldf files or does the backup procedure in the Studio
>> backup both? I set it to backup the Database.
>> Regards,
>> Robert
>>|||Hello Robert,
When you take a backup of a database, you do not need mdf or ldf files of
your database. *.BAK files (which is the backup file) contains all that
files.
This is a comman way used to copy databases or as Brett mentioned, you can
attach\detach your database files.
For additional info: Attaching and Detaching a database is the fastest
method to copy or move a database. However, it takes your database offline
and this would not be good for production environments. So, backing up a
database does not cause a problem like this.
Ekrem Önsoy
"Robert Johnson" <johnson_r@.sbcglobal.net> wrote in message
news:%23FPMBlUBIHA.4836@.TK2MSFTNGP06.phx.gbl...
> Hi all. Probably a simple thing to do but I need to know how to do this. I
> have to move the database I created in 2005 Enterprise to 2005 Express on
> my client site. Do I just do a back up and burn to a CD and after
> installing 2005 Express restore the backup? Don't I need the .mdf and the
> .ldf files or does the backup procedure in the Studio backup both? I set
> it to backup the Database.
> Regards,
> Robert
>|||Thanks Ekrem. I wasn't sure if it had all that I needed.
Regards,
Robert
"Ekrem Önsoy" <ekrem@.btegitim.com> wrote in message
news:F98D9090-F8AE-4DF2-AEFC-30898DE47197@.microsoft.com...
> Hello Robert,
>
> When you take a backup of a database, you do not need mdf or ldf files of
> your database. *.BAK files (which is the backup file) contains all that
> files.
> This is a comman way used to copy databases or as Brett mentioned, you can
> attach\detach your database files.
> For additional info: Attaching and Detaching a database is the fastest
> method to copy or move a database. However, it takes your database offline
> and this would not be good for production environments. So, backing up a
> database does not cause a problem like this.
>
> --
> Ekrem Önsoy
>
> "Robert Johnson" <johnson_r@.sbcglobal.net> wrote in message
> news:%23FPMBlUBIHA.4836@.TK2MSFTNGP06.phx.gbl...
>> Hi all. Probably a simple thing to do but I need to know how to do this.
>> I have to move the database I created in 2005 Enterprise to 2005 Express
>> on my client site. Do I just do a back up and burn to a CD and after
>> installing 2005 Express restore the backup? Don't I need the .mdf and
>> the .ldf files or does the backup procedure in the Studio backup both? I
>> set it to backup the Database.
>> Regards,
>> Robert
>>
>

How do I Modify a Stored Procedure?

I am using the sql server express manager and when I right click on
stored procedure I have a modify option. I use this, make my changes,
and hit save. But is always saves a separate .sql file and never
changes the original stored procedure. What am I doing wrong? How can
I modify the stored procedure in my database? Thank you for any help.
You have to execute the changing script, NOT saving it, which always
saves the script to a file.
HTH; Jens Suessmeyer.
http://www.sqlserver2005.de
|||Jens wrote:
> You have to execute the changing script, NOT saving it, which always
> saves the script to a file.
> HTH; Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
So you are saying that when I hit modify, change the code, and then hit
Execute (!) and that automatically saves it?
|||needin4mation@.gmail.com wrote:
> Jens wrote:
> So you are saying that when I hit modify, change the code, and then hit
> Execute (!) and that automatically saves it?
>
It's not correct wording to say it's being saved. As Jens says, you'll
have to execute the new stored procedure to get it added to the
database, but that's not the same as saving it...:-). When you save it,
it's being saved as a regular sql file but that will not do anything to
the actual SP in the database.
Regards
Steen
|||right.

How do I Modify a Stored Procedure?

I am using the sql server express manager and when I right click on
stored procedure I have a modify option. I use this, make my changes,
and hit save. But is always saves a separate .sql file and never
changes the original stored procedure. What am I doing wrong? How can
I modify the stored procedure in my database? Thank you for any help.You have to execute the changing script, NOT saving it, which always
saves the script to a file.
HTH; Jens Suessmeyer.
http://www.sqlserver2005.de
--|||Jens wrote:
> You have to execute the changing script, NOT saving it, which always
> saves the script to a file.
> HTH; Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
So you are saying that when I hit modify, change the code, and then hit
Execute (!) and that automatically saves it?|||needin4mation@.gmail.com wrote:
> Jens wrote:
> So you are saying that when I hit modify, change the code, and then hit
> Execute (!) and that automatically saves it?
>
It's not correct wording to say it's being saved. As Jens says, you'll
have to execute the new stored procedure to get it added to the
database, but that's not the same as saving it...:-). When you save it,
it's being saved as a regular sql file but that will not do anything to
the actual SP in the database.
Regards
Steen|||right.

How do I Modify a Stored Procedure?

I am using the sql server express manager and when I right click on
stored procedure I have a modify option. I use this, make my changes,
and hit save. But is always saves a separate .sql file and never
changes the original stored procedure. What am I doing wrong? How can
I modify the stored procedure in my database? Thank you for any help.You have to execute the changing script, NOT saving it, which always
saves the script to a file.
HTH; Jens Suessmeyer.
--
http://www.sqlserver2005.de
--|||Jens wrote:
> You have to execute the changing script, NOT saving it, which always
> saves the script to a file.
> HTH; Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
So you are saying that when I hit modify, change the code, and then hit
Execute (!) and that automatically saves it?|||needin4mation@.gmail.com wrote:
> Jens wrote:
>> You have to execute the changing script, NOT saving it, which always
>> saves the script to a file.
>> HTH; Jens Suessmeyer.
>> --
>> http://www.sqlserver2005.de
>> --
> So you are saying that when I hit modify, change the code, and then hit
> Execute (!) and that automatically saves it?
>
It's not correct wording to say it's being saved. As Jens says, you'll
have to execute the new stored procedure to get it added to the
database, but that's not the same as saving it...:-). When you save it,
it's being saved as a regular sql file but that will not do anything to
the actual SP in the database.
Regards
Steen|||right.sql

Wednesday, March 28, 2012

How do I locate a Database on SQL Express from Access 2003.

Access 2003 Data exported to SQL Express , great.

How do I then link the tables to the new database, I only seem to be able to link to system tables etc ?

Any ideas ?

Hi,

I assume that you are trying to link external table(s) and going through "ODBC Databases"? Then you probably have an ODBC DSN defined?

I've done that and my user table is neatly sean in the list together with the system views, etc. What you are probably experiencing is a misalignment of permissions. The following chain should be unbroken in order for you to see the user tables:

(a) Client Application security context (in this case - MSAccess)

(b) ODBC DSN connection settings - are you using SQL Authentication?

(c) SQL Server account (SQL or NT authentication)

(d) Database user associated with the account

(e) Appropriate schema/object permissions

Check each of these and see if everything is in order. You could also experiment with the SQL Management Studio or SQL Query Analyzer with the credentials used in MSAccess and see if the table(s) would be visible.

HTH,

Jivko Dobrev - MSFT

--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Many thanks, sorted, hadn't selected database from options for users.

Thanks again Racing Snake

How do I locate a Database on SQL Express from Access 2003.

Access 2003 Data exported to SQL Express , great.

How do I then link the tables to the new database, I only seem to be able to link to system tables etc ?

Any ideas ?

Hi,

I assume that you are trying to link external table(s) and going through "ODBC Databases"? Then you probably have an ODBC DSN defined?

I've done that and my user table is neatly sean in the list together with the system views, etc. What you are probably experiencing is a misalignment of permissions. The following chain should be unbroken in order for you to see the user tables:

(a) Client Application security context (in this case - MSAccess)

(b) ODBC DSN connection settings - are you using SQL Authentication?

(c) SQL Server account (SQL or NT authentication)

(d) Database user associated with the account

(e) Appropriate schema/object permissions

Check each of these and see if everything is in order. You could also experiment with the SQL Management Studio or SQL Query Analyzer with the credentials used in MSAccess and see if the table(s) would be visible.

HTH,

Jivko Dobrev - MSFT

--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Many thanks, sorted, hadn't selected database from options for users.

Thanks again Racing Snake

sql

How do i limit number of rows in a table based on dates?

Hi,
My application is written in c# and uses sql Express to store
information relating to what time employees clock in/out of work each
day.
How can i restrict the amount of rows in my attendance database table
so that entries older than 3 months are automatically deleted from the
database?
Thanks in advance!
KHi
I'd create a stored procedure that does deletion and then create a
job(weekly...) that will run this SP
<kls.systems@.btinternet.com> wrote in message
news:1176719432.941536.219550@.o5g2000hsb.googlegroups.com...
> Hi,
> My application is written in c# and uses sql Express to store
> information relating to what time employees clock in/out of work each
> day.
> How can i restrict the amount of rows in my attendance database table
> so that entries older than 3 months are automatically deleted from the
> database?
> Thanks in advance!
> K
>|||Thanks for the help uri, I thought that sql express couldnt use
scheduled jobs though as it doesnt use sql agent?
Thanks again.|||Ah I see, did not read properly your post
Perhaps here you will find some info
Automating Database maintenance in SQL 2005 Express Edition Part I
http://www.sqldbatips.com/showarticle.asp?ID=27
Automating Database maintenance in SQL 2005 Express Edition Part II
http://www.sqldbatips.com/showarticle.asp?ID=29
<kls.systems@.btinternet.com> wrote in message
news:1176721669.824203.42940@.l77g2000hsb.googlegroups.com...
> Thanks for the help uri, I thought that sql express couldnt use
> scheduled jobs though as it doesnt use sql agent?
> Thanks again.
>|||How about using a .sql script file, execute it using SQLCMD (in a .bat file) and use the Windows
scheduler to execute that .bat file?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<kls.systems@.btinternet.com> wrote in message
news:1176721669.824203.42940@.l77g2000hsb.googlegroups.com...
> Thanks for the help uri, I thought that sql express couldnt use
> scheduled jobs though as it doesnt use sql agent?
> Thanks again.
>|||On 16 Apr, 12:22, "Uri Dimant" <u...@.iscar.co.il> wrote:
> Ah I see, did not read properly your post
> Perhaps here you will find some info
> Automating Database maintenance in SQL 2005 Express Edition Part Ihttp://www.sqldbatips.com/showarticle.asp?ID=27
> Automating Database maintenance in SQL 2005 Express Edition Part IIhttp://www.sqldbatips.com/showarticle.asp?ID=29
> <kls.syst...@.btinternet.com> wrote in message
> news:1176721669.824203.42940@.l77g2000hsb.googlegroups.com...
>
> > Thanks for the help uri, I thought that sql express couldnt use
> > scheduled jobs though as it doesnt use sql agent?
> > Thanks again.- Hide quoted text -
> - Show quoted text -|||Thanks very much for all of your help, I'll try setting up a windows
scheduled job to run an sql script to do this as suggested in the
articles you provided links for.
I just thought there would have been a quick and easy setting within
management studio express i could configure to do it but nevermind!
Thanks very much again for your help Uri, very much appreciated.

Friday, March 23, 2012

How do I import Excel file into SQL Express??

Hello,

I am total beginner to SQL and want to import an Excel file into SQL but I'm not sure where to start. The Excel file is a small company directory, names, addresses etc., not too big.

Any help would be greatly appreciated!!!!hi..
my adivice is dont use excel, create a MS-Access data base and import that into sql..|||thanks for the post.

Assuming I am able to create an MS Access database, what are the steps to importing this file into SQL?

thanks|||1.right click on any database
2.select TASKS and then select IMPORT DATA after clicking
this one dialog box will appear,click NEXT
3.Choose MICROSOFT ACCESS as DATA SOURCE,then BROWSE ur access file then click NEXT
4.Chosse the DESTINATION[SQL native client]
5.Select the SERVERNAME
6.There are two AUTHENTICATION, select the SQL SERVER AUTHENTICATION and give the USERNAME & PASSWORE
7.Select the DATABASE and then click next
8.select "COPY DATA FROM ONE OR MORE TABLES OR VIEWS" then click next
9.the tables what you created in access will be showed here
10.select the tables which you want to insert and then click next
11.select the "EXECUTE IMMEDIATELY" check box and then click next
12.click finish
13.it takes some time to process and finallY, if there are no mistakes,it executes
successsfuly else it shows the error message|||You can't Import / Export using the Express editions.|||

Quote:

Originally Posted by Tros

You can't Import / Export using the Express editions.


Seems it may be round about, Excel -> Access -> SQL Express.|||When you download the SQL Express software, I believe it comes with a 'wizard' called DTS Wizard. It allows you to transfer among all the previously mentioned types.sql

Monday, March 19, 2012

How do i get rid of a SQL Server login-prompt.

I've got an access 2k2 front-end with a SQL Server express 2005 table
holding all the data.
I've got SQL Server authentication on.
Everytime i open the front-end i have to use my SQL Server
username/login I previously set-up.
I have been told to take out the prompt but cant seem to track down the
solution to this.
Security is not an issue.If you must use SQL server login then use the save password function when
you create the linked tables in Access.
--
Regards,
Dave Patrick ...Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
"p" <p.macrae@.gmail.com> wrote:
> I've got an access 2k2 front-end with a SQL Server express 2005 table
> holding all the data.
> I've got SQL Server authentication on.
> Everytime i open the front-end i have to use my SQL Server
> username/login I previously set-up.
> I have been told to take out the prompt but cant seem to track down the
> solution to this.
> Security is not an issue.
>|||damn that was easy thanks
Dave Patrick wrote:
> If you must use SQL server login then use the save password function when
> you create the linked tables in Access.
> --
> Regards,
> Dave Patrick ...Please no email replies - reply in newsgroup.
> Microsoft Certified Professional
> Microsoft MVP [Windows]
> http://www.microsoft.com/protect
> "p" <p.macrae@.gmail.com> wrote:
> > I've got an access 2k2 front-end with a SQL Server express 2005 table
> > holding all the data.
> > I've got SQL Server authentication on.
> >
> > Everytime i open the front-end i have to use my SQL Server
> > username/login I previously set-up.
> > I have been told to take out the prompt but cant seem to track down the
> > solution to this.
> >
> > Security is not an issue.
> >|||You're welcome.
--
Regards,
Dave Patrick ...Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
"p" wrote:
> damn that was easy thanks

How do i get rid of a SQL Server login-prompt.

I've got an access 2k2 front-end with a SQL Server express 2005 table
holding all the data.
I've got SQL Server authentication on.
Everytime i open the front-end i have to use my SQL Server
username/login I previously set-up.
I have been told to take out the prompt but cant seem to track down the
solution to this.
Security is not an issue.
If you must use SQL server login then use the save password function when
you create the linked tables in Access.
Regards,
Dave Patrick ...Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
"p" <p.macrae@.gmail.com> wrote:
> I've got an access 2k2 front-end with a SQL Server express 2005 table
> holding all the data.
> I've got SQL Server authentication on.
> Everytime i open the front-end i have to use my SQL Server
> username/login I previously set-up.
> I have been told to take out the prompt but cant seem to track down the
> solution to this.
> Security is not an issue.
>

How do i get rid of a SQL Server login-prompt.

I've got an access 2k2 front-end with a SQL Server express 2005 table
holding all the data.
I've got SQL Server authentication on.
Everytime i open the front-end i have to use my SQL Server
username/login I previously set-up.
I have been told to take out the prompt but cant seem to track down the
solution to this.
Security is not an issue.If you must use SQL server login then use the save password function when
you create the linked tables in Access.
Regards,
Dave Patrick ...Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
"p" <p.macrae@.gmail.com> wrote:
> I've got an access 2k2 front-end with a SQL Server express 2005 table
> holding all the data.
> I've got SQL Server authentication on.
> Everytime i open the front-end i have to use my SQL Server
> username/login I previously set-up.
> I have been told to take out the prompt but cant seem to track down the
> solution to this.
> Security is not an issue.
>|||damn that was easy thanks
Dave Patrick wrote:[vbcol=seagreen]
> If you must use SQL server login then use the save password function when
> you create the linked tables in Access.
> --
> Regards,
> Dave Patrick ...Please no email replies - reply in newsgroup.
> Microsoft Certified Professional
> Microsoft MVP [Windows]
> http://www.microsoft.com/protect
> "p" <p.macrae@.gmail.com> wrote:|||You're welcome.
Regards,
Dave Patrick ...Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
"p" wrote:
> damn that was easy thanks

Monday, March 12, 2012

How do I generate auto increment number in SQL Express?

Hi, in Access, I can use an Auto-Increment number for my primary key field. May I know how do I do that in SQL Express? In addition, is there any tutorial on how to use SQL Express to generate customised unique numbers (such as membership number, Customer ID such as A001 where A is based on the customer's name while 001 is due to the fact that the customer is the first among those with names starting with A)?Thanks a lot.For your first question: In SQL Server, you can use data type int as your identity column and assign this column as indentity field from the property window. It will work like autonumber field in Access.|||

cckiat:

Hi, in Access, I can use an Auto-Increment number for my primary key field. May I know how do I do that in SQL Express? In addition, is there any tutorial on how to use SQL Express to generate customised unique numbers (such as membership number, Customer ID such as A001 where A is based on the customer's name while 001 is due to the fact that the customer is the first among those with names starting with A)? Thanks a lot.

IDENTITY is the auto increament in SQL Server it is a property of the column, the second one you described is a SEQUENCE it is in Oracle not SQL Server but it is similar to IDENTITY. Both are defined by ANSI SQL but Microsoft and Oracle choose to implement one and not the other. But you can use GUID in SQL Server to generate Unique numbers but it is a 16bytes Binary data type so use it with care. Hope this helps.

Friday, March 9, 2012

How do I find the server name?

I need to deploy a multi-user application to several different customers. My app was built on VB.net and uses SQL Server Express. For remote client to connect to the server I understand that I need to use a connection string something like this:
“Server=ServerName;Database=myDB;Trusted_Connection=True;”

My question is, how will I know what the server name is? Can that be different for different customers? When I test this on my PC, I use (Server=.\SQLEXPRESS;), but what do I use for deployment?

Thanks.

hi,

for each "remote" client, you have to store (on each client) the server instance name they are pointing to...

if I have to connect form my machine to your SQLExpress instance, I should connect to YourMachineName\SQLExpress, as you installed a named instance...

you can perhaps have a look at http://www.sqldev.net/misc.htm for 3 different way to enlist SQL Server instances on the lan...

regards

|||

Thank you Andrea for your response. I would like to make the installation an automated process using InstallShield. I will have two install packages - one for Server and the other for Clients. How can I find the ServerName during the client install?

P.S: I was trying to locate a relevant article/info at the site you mentioned, but could not find any. I would appreciate it if you can point me to a specific article.

|||

hi,

unfortunately, usually you can't...

say you install the "clients" before SQL Server ()... how can you tell what the server name is?

you can perhaps, in your InstallShield code, try instantiating a SQL-DMO.SQLServer object to perform a network scan of installed instances, but this will fail if SQL-DMO has not been already locally installed on the client workstation..

but you can find "smart" solutions.. you can define a share where all your client will point to in order to read some "config" file where they can find the SQL Server they will connect to, but you are there again.. how can you define the network share your app should look for at install time?

so just provide, in your client application, a tool\dialog to define the server name.. at very first startup it could be void and the dialog can automatically pop up, so that the user can finally "browse for installed SQL Server instances" the way you like or is just required to type it's name as the local admin already reported him by internal mail

regards

|||

Thank you for your reply. I have written below what I am thinking as to how I may go about it. Please review and let me know if you have suggestions or comments.

On the install CD, there will be only a Server Install package. During the server installation, it creates a "Client Install" folder and copies Client Install files to that folder. Also it creates a text file called "ServerName.txt" in the same folder and writes the Server's Computer name on it.

To install a client, from the client machine user needs to access the folder on the server and run install. The Client install process reads the Server Computer Name and creates a registry entry on the client.

My application, when run, it reads the "Server's Computer Name" from the registry and coins the connection string and connects to the server.

Please let me know if I can make this process more efficient.

Thanks.

|||

hi,

yes, this can be a "smart" solution...

regards

How do I find out what Service Packs have been installed?

I'm using SQL Server Express on Vista. I can't remember whether or not I installed the service packs for SSEE. Is there a quick and easy way to find out?

hi,

you can query som server properties as (on my running server)

SET NOCOUNT ON; SELECT CONVERT( varchar, SERVERPROPERTY('Edition')) AS Edition , CONVERT( varchar, SERVERPROPERTY('ProductVersion')) AS Version , CONVERT( varchar, SERVERPROPERTY('ProductLevel')) AS Level --< Edition Version Level Express Edition 9.00.3159.00 SP2

regards

Wednesday, March 7, 2012

How do I export my database from SQL Server Management Studio Express

Hi

I am using SQL Server Management Studio Express to make my databases but I noticed if I make my database in Visual studios and go new Item and make a new database I see it in app_data folder and server express tab and if I make it in SQL Server Management Studio Express I only see it in the server explorer.

So if I have to move my files to another computer how do I move my database easly with SQL Server Management Studio Express? Since when you make it with the visual studio the file gets stored with all the other files of your project so if you move it all to another computer you prob won't run into a problem.


So how do I make it that so I can do everything in SQL Server Management Studio Express(since I like working in it) then export it into a file that I can then go into my app_data folder and add it is an exist item?

Thanks

Hi chobo2,

Generally speaking, when you create a new database through Management Studio, the database file will be stored at: %yoursqlinstallationpath%MSSQL.1\MSSQL\Data. If you want to access it through your Visual Studio you must first connect to it(server exploer--> new connection).

And if you create a new database through Visual Studio, the database file will be stored in you application App_Data folder.You can access to it directly through both Visual Studio and Management Studio.

As to export a database file to new location(or migrate databae), as far as i know, you have 2 options:

1: Detach and Attach:

Detach the database from original database Server and copy the physical database files(*.mdf and *.ldf) to the new location.At the new server side, you put the physical database files to a certain place(generally speaking it's the default sql server database folder), and attach to the database again;

2:Use Backup and Restore:

In your original database server you can make a backup of your database file and store it to a certain place(*.bak).Take the *.bak file to the new server and in the new database server, restore that database.

You can implement the above 2 methods in sql2000, sql express, or sql 2005. However, detailed operations could be different if you use different verstions of sql server.

Hope my suggestion helps

Friday, February 24, 2012

How do I do this with SQL Express?

Hi,

In Microsoft Access when I had a one-to-many relationship between tables, I could (in the master\parent) table enter a record and a plus symbol would appear enabling me to enter the many side details. How can this be done in SQL Express?

Thanks for your help

A

hi A,

what do you mean by that?

SQLExpress is "just" an engine where Access (in this case) is a client application... you have to programmatically deal this in your app as you require... say something similar to http://search.msdn.microsoft.com/search/default.aspx?siteId=0&tab=0&query=master+detail

regards

Sunday, February 19, 2012

How do I display a SSRS report in a web page?

I have developed a web site with Visual Web Developer 2005 Express, and SQL Server 2005. After 18 months I have a reasonable understanding of VB.net and SQL Server programming, but I am a complete newbie with Sql Server Reporting Services. SSRS seems to be pretty easy and mostly intuitive for the simple tasks that I've tried, although so far I haven't progressed beyond developing a report and displaying it in the preview tab.

I am now trying to display my first report from within my web site, so that clicking a button on the prior page displays the report, presumably with Response.Redirect("~/Reportpage?Query") where "ReportPage" is the url of a page to display the report, and Query gives the report parameters in the usual style of a request query. The target page could either be a normal .aspx page with the report embedded in the design, perhaps as an IFrame, or it could be a page produced directly by SSRS. I'd prefer the .aspx approach as it would allow me to use my usual master page with its standard on-entry logic, unless the direct-SSRS approach is much easier.

On clicking around in the HELP trying to find how to do this, the HELP seems to imply that I should embed a reportviewer control in my page? Is this right? If yes, where do I get this from? It is not in the VWD 2005 toolbox, but perhaps I have to import it. I am using SSRS within Visual Studio 2005: have I reached the point where I have to move beyond VWD 2005 Express and upgrade to the full Visual Studio?

Hi,

You can either give the report url, but the best way is to use Report viewer control. Its a microsoft inbuilt control. Include the below name space b4 using it

<%@.RegisterAssembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"Namespace="Microsoft.Reporting.WebForms"TagPrefix="rsweb" %>

Hope this is helpful to u

|||

OK, I've added this into my web page, so that it now starts: -
<%@. Page Language="VB" MasterPageFile="~/GDBMaster_P.master" AutoEventWireup="false"
CodeFile="GDB_PR2des.aspx.vb" Inherits="UploadedDocs_GDB2" Title="GDB2" %>
<%@. Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

and continues with the XML describing the page.

Now what? How do I use the report viewer control? Do I need to add it to the toolbox, or do I code something like "<rsweb parameters/> " into the source of my page.

If toolbox, how do I add it? If source, where do I find out what the properties are?"

|||

Hi,

You can follow the steps below to add your report viewer.

In Solution Explorer, right-click Default.aspx, select View Designer.

Open the Toolbox window. From the Data group, drag a ReportViewer control onto the page.

If it is not already open, open the ReportViewer Tasks smart tag panel by clicking the triangle in the upper right corner of the ReportViewer control on the Web page. In the Choose Report box, select the fully qualified file name for Report.rdlc.

When you select a report, instances of data sources used in the report are created automatically. Code is generated to instantiate each DataTable (and its DataSet container) and an ObjectDataSource control corresponding to each data source used in the report. This data source control is configured automatically.

For more information, see:
http://msdn2.microsoft.com/en-us/library/ms252123(VS.80).aspx

Thanks.

|||

Thank you for your reply, but there is still a problem. Your reply describes exactly the process that I had expected, and so I had searched the toolbox for a ReportViewer control before I posted this question (see my first post of this thread). I had expected that "Data" would be the most likely group, but I checked them all anyway. My data group contains only these controls: -
Pointer
Gridview
DataList
DetailsList
Formview
Repeater
SQLDataSource
AccessDataSource
ObjectDataSource
XMLDataSource
SiteMapDataSource

So the key question is, How do I get a reportviewer control into this group?

Regards, Robert

|||

Hi, If u could not able to find reportviewer in your toolbox add the following references

Microsoft.ReportViewer.Common.dll

Microsoft.ReportViewer.WebForms.dll

u can find these dlls in the path

C:\Program Files\Microsoft Visual Studio 8\ReportViewer

Then u right click the tool box and select new items to add in it. Add Report Viewer (Name Space Microsoft.Reporting.Webforms).

U can c the reportviewer control in ur toolbox now

|||

Thank you! That's put the ReportViewer into the toolbox, and now my test page has a ReportViewer control.

Next problem: selecting the report. This is not going smoothly. When I open the smart tag, options are "Choose Report" and "Design a new report".

If I click "Choose Report" the only option is <Server Report> so I select that. The ReportserverURL appears as http://localhost/reportserver, and I am asked to enter the report name.

I enter C:\Documents and Settings\Robertb.ROBERTB\My Documents\Visual Studio 2005\Projects\GDBReports\GDBReports\GDBReport1.rdl (Nai-Dong Jin's post said to select "report1.rdlc", but there are no .rdlc files).

Now I test my web page, by clicking on

Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. The request failed with the error message: --
  • Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. The request failed with the error message: -- <html> <head> <title> SQL Server Reporting Services </title><meta name="Generator" content="Microsoft SQL Server Reporting Services 9.00.3042.00" /> <meta name="HTTP Status" content="500" /> <meta name="ProductLocaleID" content="9" /> <meta name="CountryLocaleID" content="1033" /> <meta name="StackTrace" content=" at Microsoft.ReportingServices.Library.ConnectionManager.OpenConnection() at Microsoft.ReportingServices.Library.Global.get_SharePointIntegratedFlagFromCatalog() at Microsoft.ReportingServices.WebServer.Global.RunOnlyOnceStartReportServer() at Microsoft.ReportingServices.WebServer.Global.StartApp() at Microsoft.ReportingServices.WebServer.Global.Application_BeginRequest(Object sender, EventArgs e)" /> <style> BODY {FONT-FAMILY:Verdana; FONT-WEIGHT:normal; FONT-SIZE: 8pt; COLOR:black} H1 {FONT-FAMILY:Verdana; FONT-WEIGHT:700; FONT-SIZE:15pt} LI {FONT-FAMILY:Verdana; FONT-WEIGHT:normal; FONT-SIZE:8pt; DISPLAY:inline} .ProductInfo {FONT-FAMILY:Verdana; FONT-WEIGHT:bold; FONT-SIZE: 8pt; COLOR:gray} A:link {FONT-SIZE: 8pt; FONT-FAMILY:Verdana; COLOR:#3366CC; TEXT-DECORATION:none} A:hover {FONT-SIZE: 8pt; FONT-FAMILY:Verdana; COLOR:#FF3300; TEXT-DECORATION:underline} A:visited {FONT-SIZE: 8pt; FONT-FAMILY:Verdana; COLOR:#3366CC; TEXT-DECORATION:none} A:visited:hover {FONT-SIZE: 8pt; FONT-FAMILY:Verdana; color:#FF3300; TEXT-DECORATION:underline} </style> </head><body bgcolor="white"> <h1> Reporting Services Error<hr width="100%" size="1" color="silver" /> </h1><ul> <li>The report server cannot open a connection to the report server database. A connection to the database is required for all requests and processing. (rsReportServerDatabaseUnavailable) <a href="http://links.10026.com/?link=http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsReportServerDatabaseUnavailable&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=9.00.3042.00" target="_blank">Get Online Help</a></li><ul> <li>An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)</li> </ul> </ul><hr width="100%" size="1" color="silver" /><span class="ProductInfo">SQL Server Reporting Services</span> </body> </html> --.|||

    Hi,

    and I am asked to enter the report name. I enter C:\Documents and Settings\Robertb.ROBERTB\My Documents\Visual Studio 2005\Projects\GDBReports\GDBReports\GDBReport1.rdl (Nai-Dong Jin's post said to select "report1.rdlc", but there are no .rdlc files).

    Here, what the system is asking your to enter a rdlc file. This file must be created in your website application by adding new items in your previous steps. Now the following are the whole steps for you, which comes from that link in my previous post:

    From the Website menu, select Add New Item.

    From the Add New Item dialog, select the Report template, enter a name for the report file, and then click Add. This creates a report definition file (the default is Report.rdlc), launches the Report Designer, and displays the Website Data Sources pane.

    Thanks.

    |||

    How do I add the report template to the "add new item" dialog?

    Thanks, Robert.

    |||

    Hi,

    Let's see the whole procedure, our aim is to create a report for a Microsoft Visual Studio 2005 ASP.NET Web site and add a ReportViewer control to a Web page so users can view the report.

    1. First, you should create a new Web site, and create a default.aspx page, switch it to the design mode.

    2. You may define a data connection and DataTable by adding a DataSet.

    3. It's an important step Design the report.

    1). From the Website menu, select Add New Item.

    2). From the Add New Item dialog, select the Report template, enter a name for the report file, and then click Add. This creates a report definition file (the default is Report.rdlc), launches the Report Designer, and displays the Website Data Sources pane.

    3). Open the Toolbox. Click on a textbox and then on the report design surface.

    4). Enter a report title in the textbox: # of Employees per Shift per Dept. Expand the textbox if necessary.

    5). From the Toolbox, drag a Matrix report item onto the report below the textbox. The dotted white background is your report page. To adjust the matrix location on the page, click the left corner to select it, and drag or use arrow keys to move the item as needed.

    6). From the Website Data Sources window, expand the DataTable1 node until you see the columns from your query. Drag Dept onto the Rows textbox in the first column, second row of the matrix.

    7). Drag Shift onto the Columns textbox in the second column, first row of the matrix. While the textbox is selected, in the Properties window, set the TextAlign property to Right. Click in the textbox to activate the Report Formatting toolbar, and click the Bold button.

    8). Select the matrix by clicking anywhere in the matrix. Right-click and select the matrix by name (the default is matrix1). An outline will appear around the matrix report item. Right-click the outline and select Properties. Check that the title of the dialog that opens is Matrix Properties.

    9). Click the Groups tab. In the Columns section, click Edit.

    10). In the Sorting and Grouping dialog, click the Sorting tab.

    11). Click in the first box under Expression to activate the textbox. From the drop-down list, choose =Fields!Dept.Value. This ensures the report data will be sorted by Department name. Click OK.

    12). Click OK to close the Matrix Properties dialog.

    13). From the Website Data Sources window, drag the EmployeeID field onto the Data textbox in the second column, second row of the matrix. Right-click this textbox and select Expression.

    14). Edit the default Sum aggregate function and change it to Count. Click OK.

    15). Click OK to close the Textbox Properties dialog.

    16). On the File menu, select Save All.

    4. The last step: Add a ReportViewer control to the application

    1). In Solution Explorer, right-click Default.aspx, select View Designer.

    2). Open the Toolbox window. From the Data group, drag a ReportViewer control onto the page.

    3). If it is not already open, open the ReportViewer Tasks smart tag panel by clicking the triangle in the upper right corner of the ReportViewer control on the Web page. In the Choose Report box, select the fully qualified file name for Report.rdlc.

    Thanks.

    |||

    I have not created a new website, as everything should work the same way on a new page within my existing website. Apart from that difference, I have been trying to follow the procedure above. Where I'm stuck: -

    From the Add New Item dialog,select the Report template, enter a namefor the report file, and then click Add.

    There is no report template within my Add New Item dialog. In my previous post I asked how to add it. I expect that once I have this, it will be easy, but without it I'm stuck.

    Thanks, Robert

  •