Thursday, March 22, 2012
adventureworks db and dw not showing up in management studio database list
AdventureWorks Database not showing up management studio express
After installing the Adventure works database samples they do NOT show up in Management Studio Express?
I have done a clean install of SQL Server Express 2005 SP1 with Advanced services.
The database samples only install as physical files, they are not attached to the SQL Server process. If you want to use them, go in the SSMS and right click on the Database node, choose All Tasks and click Attach database.. Locate the MDF File and the LDF File and click Apply (or OK). SQL Server will attach the databases to the SQL Server process and you can access the data.HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
|||I found this not quite accurat. The Attach is in the Object Explorer window under the sqlexpress datebase, right click Databases (nt Database) then click Attach. The window which opens should show the AdventureWorks database without having to browse. This required action is not mentioned in the tutorial.
AdventureWorks Database not showing up management studio express
After installing the Adventure works database samples they do NOT show up in Management Studio Express?
I have done a clean install of SQL Server Express 2005 SP1 with Advanced services.
The database samples only install as physical files, they are not attached to the SQL Server process. If you want to use them, go in the SSMS and right click on the Database node, choose All Tasks and click Attach database.. Locate the MDF File and the LDF File and click Apply (or OK). SQL Server will attach the databases to the SQL Server process and you can access the data.HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
|||I found this not quite accurat. The Attach is in the Object Explorer window under the sqlexpress datebase, right click Databases (nt Database) then click Attach. The window which opens should show the AdventureWorks database without having to browse. This required action is not mentioned in the tutorial.sql
Sunday, March 11, 2012
Advanced Identity Fields
Hi!
a) PROBLEM 1:
I have set up my main database like this (of course I'm showing an abbreviation):
company - int (identity)
name - nchar
I have several companies stored in the previous table. Now I have another table with messages:
company - int (related with the company of the previous table)
messageID - int (identity)
contents - nchar
company and messageID are the main key of this table. I want to set the messageID column to change automatically. Since I declared it as identity it is working fine, but I was looking to start it on 0 on every new company:
Company messageID
0 0
0 1
0 2
1 0 <- Here the company changed, so the messageID resets
1 1
1 2
1 3
2 0 <- Again
2 1
Any suggestions?
b) PROBLEM 2:
I have my database stored locally on my computer. When I finished working with the database it has a lot of data for testing. I want to upload the database to my hosting provider or to my customer's. But the identity columns keep incrementing since the last value of my tests, so it's kind of annoying to see values as: 1250, 223, etc. when I expect to see 0,1, 2 and so on. Also, for receipts this is a very important issue.
How can I reset the identity fields?
Thank you very much for your attention and help.
CT
DBCC CHECKIDENT (tblName, RESEED, 0)
so the next record will start from 1
HTH
#1 You have to create trigger on this table for insert which will automatically calculate your message ID based on number of messages for company for which you insert record.
# 2 I suppose that you would like to remove test data from your table so you will be safe using TRUNCATE TABLE to delete all records and reset identity to 1
|||I really appreciate if you can give a sample for this. I'm worried that the trigger procedure wont be able to handle concurrency.Monday, February 13, 2012
ADO Application Name not showing up in SQL Server Profiler
I can't seem get to get my application name to show up for
SQL:BatchCompleted messages. It shows up in the SQL:BatchStarting,
SQL:StmtStarting and SQL:StmtCompleted events.
After the connection string is set, I append ";Application Name=MyApp".
Has anyone seen this? Am I missing something?"Isaac Alexander" <isaacNOSPAM@.goNOSPAMprocura.com> wrote in message
news:eucFm3ytGHA.3264@.TK2MSFTNGP03.phx.gbl...
>I am using MS SQL Server 2005 and SQLOLEDB.1
> I can't seem get to get my application name to show up for
> SQL:BatchCompleted messages. It shows up in the SQL:BatchStarting,
> SQL:StmtStarting and SQL:StmtCompleted events.
> After the connection string is set, I append ";Application Name=MyApp".
> Has anyone seen this? Am I missing something?
>
Please ignore this message. I'm still learning the 2005 SQL Profiler. I
started with the template and the SQL:BatchCompleted didn't include the
Application Name column. I added the stored procedure event with the
Application Name column, but it showed up blank on the SQL:BatchCompleted
event since it wasn't checked in the options.
... fun.
ADO Application Name not showing up in SQL Server Profiler
I can't seem get to get my application name to show up for
SQL:BatchCompleted messages. It shows up in the SQL:BatchStarting,
SQL:StmtStarting and SQL:StmtCompleted events.
After the connection string is set, I append ";Application Name=MyApp".
Has anyone seen this? Am I missing something?"Isaac Alexander" <isaacNOSPAM@.goNOSPAMprocura.com> wrote in message
news:eucFm3ytGHA.3264@.TK2MSFTNGP03.phx.gbl...
>I am using MS SQL Server 2005 and SQLOLEDB.1
> I can't seem get to get my application name to show up for
> SQL:BatchCompleted messages. It shows up in the SQL:BatchStarting,
> SQL:StmtStarting and SQL:StmtCompleted events.
> After the connection string is set, I append ";Application Name=MyApp".
> Has anyone seen this? Am I missing something?
>
Please ignore this message. I'm still learning the 2005 SQL Profiler. I
started with the template and the SQL:BatchCompleted didn't include the
Application Name column. I added the stored procedure event with the
Application Name column, but it showed up blank on the SQL:BatchCompleted
event since it wasn't checked in the options.
... fun.