subject says it all -- is it possible to automatically expand the identity specification node in table properties for the Management Studio or VS2005 diagram mode? when creating a DB, it seems ridiculous that for EVERY table I have to add an extra click to get to just one more clickable item that ought to be exposed by default.
Hi, How do I determine what the next "id" will be in a collumn where the Identity Specification is turned on with Identity Increment? I have two tables, the one contains product information and the other is a photo album. When I create a new product, then I automatically create an associated photo album. It all works fine, but I have found some problems after using this setup for a while to manage products. For example, say I have created 10 products (id's 1 to 10) , and then I decide to remove the last 5 products from the list. The next time I add a new product, it will be product number 6, but the id will be 11 (seeing that the id's will always be unique). How do I determine what the next Identity value will be seeing that the actual last id might not be the last one that was allocated? RegardsJan
I am not very clear about the use of 'identity specification properties'. There does not seem to be a great use of identity increments and seeds, it seems something that saves manual work, but to a very little extent Anyone willing to shed some light?
what happens when a column marked as Identity Specification reaches the limit? for example, I have some code tables using tinyints as keys, the actual number of entries will be 20 or so but there is some volatility, so eventually the 255 limit will be reached, what happens then?
the same thing applies to ints or bigints used as keys, eventually the database must run out of numbers
I need some help. I'm running Win2000 w/SQL 2000 Active/Active cluster. I've started having problems where one node will fail over automatically every night. The times are different each night and the only thing that shows up in the log file is the SQL Server terminated due to stop request from the service control manager. I can't find any error to point me in any direction. Does anyone have any idea what could be causing this?
I am trying to build a Windows application using: Windows XP Pro ; VS Pro 2005, C# and SQL2005.
I have a database table as follows: eg 1) myGameRecency which contains columns : GameId (identity specification column/primary key/not null), Date (not null), [1], [2], [3], [4]
Using the myGameRecencyAllBalls table ---
I wish to insert a date into a new row but have not been able to determine how to with the identity specification on the GameId column.
Can anyone please assist? Thank you. lpbcorp
sqlCmd.CommandText = "DECLARE @date datetime SET @date = '" + Date +
"DECLARE @lastRowGameId int " +
"DECLARE lastrow_gameidcursor CURSOR SCROLL FOR " +
"(SELECT GameId FROM " + DBGameName.ToString() + "RecencyAllBalls) " +
"OPEN lastrow_cursor " +
"FETCH LAST FROM lastrow_gameidcursor INTO @lastRowGameId " +
"' INSERT INTO " + DBGameName.ToString() + "RecencyAllBalls.Date VALUES (@date) WHERE GameId = @lastrow_gameidcursor + 1";
First of all, I'm new to the forums, and I'm still getting started with VBEE and SQL.
I'm building a simple Windows Application that has a SQL Database with three tables, related to each other. In all of them I need to set one column as a simple index for the rows (1, 2, 3... etc), to work as a PK and relate to the other tables' FKs.
I've set the property Identity Specification of the column to Yes, and added some rows of data for testing. If you just keep adding rows, the PK columns work fine, but if you start deleting rows, the numbering gets fragmented, and the relations between the tables lose integrity.
I've tried the MSDN Online Help topics, but they just tell you this:
If an identity column exists for a table with frequent deletions, gaps can occur between identity values. If you want to avoid such gaps, do not use the identity property.
So, my questions are: is there another way around this problem? How to number rows automatically and re-number them when a row is deleted, and keep the table relations working? It has anything to do with constraints?
Sorry if my question was already answered, I really couldn't find anything like my problem searching the forums. Thanks in advance.
Using Management Studio, when I import data from one identical database to another, any identity specifications get dropped from the destination database.
(From columns which have them on the source database and which had them on the destination database.)
Ok I am faced with working with XML on a regular basis, which is fine.
DECLARE @ViewSN INT IF NOT EXISTS (select null from tblviews where viewcode = 'loadAtTerm') --<workflowEventType>loadAtTerminal</workflowEventType> insert into tblviews (ViewName,Description,OutBoundForm,StoredProcSN,TriggersReply,ViewCode,DispXactLayer,DispXactViewType,DispXfcTag,Comments) select 'QC:WF-LoadAtTerminal','This View Corresponds to the XML for loadAtTerminal in Omnitracs Workflow','0',NULL,'0', 'loadAtTerm','MCOM','MCOM',NULL,NULL
[code]...
What would be really useful is to be able to present any xml file and automatically parse the NODE names into a memory variable table and then the fields of each node in another.
If I right click on a primary key in SQL Server management studion, I can set the identity specification for a primary keyId so that it is indexible. I do this by setting the properties for "Is Identity", "Identity Increment", and "Identity Seed". This is wonderful, but I have been asked to perform this using a script instead of the SQL server GUI/Sql Server management studio. Is this possible? Does anyone know how to do this? If so, can you show me how? Ralph
Hi, I am having a bit of hassle with trying to enter details to multiple tables in SQL Server 2005. I have four tables, an Attendance Table (AttendanceID(PK Identity specific), MembershipNo, Date) Resistance Table (ResistId(PK Identity specific), Weight , Reps, Sets) Aerobics Tables(AerobicsID(PK Identity specific), MachineID, Intensity, Time) and a linking table for all of them.... ExerciseMaster(AttendanceID,ResistanceID,AerobicsI D)
My problem is that I can insert data to each specific table by itself using seperate insert statements.....eg....
//insert an attendance record to the attendance table string userID;
userID = Session["User"].ToString();
SqlDataSource pgpDataSource = new SqlDataSource(); pgpDataSource.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionStringLogin"].ToString();
finally { pgpDataSource = null; } //same code as above for the resistance table
However, i am facing the problem where this does not populate the link table(ExerciseMaster) with any information as i am unable to write the relevant IDs into the table that have been auto generated by SQL Server for each of the subTables. I have read several forums where they recommend using something called @@IDENTITY but i have no idea how or where to use this in order to fill my exercise table... Any help would be so much appreciated.... Also, hopefully what i have said all makes sense and someone will be able to help me...oh and one more thing...this is an ASP.NET page coding in C# Cheers Scotty
I have not used log shipping before and find myself in a position where I need to reboot the secondary node and then the primary node and I don't actually need to failover.
Is there anything I need to be aware of. When rebooting the secondary node I assume the transactions will be held in the primary nodes log till the secondary comes back and just carry on once back up?
When rebooting the primary node nothing needs to be done and the log shipping will just start again once it has come back?
But I'm not sure if I have to install SQL Server first on node 2, then add it to the cluster. Or does adding it to the cluster also install the software?
I'm contemplating running two availability groups on a two node WSFC. The WSFC is setup with a file share witness (i.e. no shared storage). Can I safely run 1 AG on one primary node, and the other AG on the other node (as primary). Each AG would have replicas on the passive node. This would effectively allow both servers to be in use at the same time. In a failover event, I understand that both workloads would transfer to a single server - so the box needs to be sized appropriately.
We are in the process of building a 3 node SQL Server Cluster (Server 2012/ SQL Server 2012), and we have configured the quorum so that all 3 nodes have a vote (no file share witness as we already have an odd number of nodes).
As I understand it, this should allow the cluster to run as long as 2 of the nodes remain online.
However, the validation report states that 2 node failures would be acceptable and, when we tested this by powering off two of the nodes, the cluster did indeed continue to run on a single node.
I configure Windows 2003 R2 and SQL 2005 two nodes Cluster. When I move cluster resource from one node to anther node it takes around 30 seconds to become online. So in that time if any query is running it stops responding.
I invoke xp_cmdshell proc from inside a stored procedure on a 2-node active/passive SQL 2005 SP2 Standard cluster. Depending on which server the xp_cmdshell gets executed on I need to pass different arguments in the shell command. I thought I could use host_name() function to get the runtime process server, however, I am finding that it's not behaving correctly. In one example I know my active node is server2, but the host_name() function is returning server1. The only thing that I could possible explain this is that the MSDTC cluster group is not always on the same active node as the SQL server group and in the case I am talking about the cluster groups are in this mode (differnet nodes). Does the xp_cmdshell get executed by the SQL active node or the MDTC active node? And what is the best way to find out which server is going to run my xp_cmdshell?
Thanks.
Edit:
Perhaps another by product of this is that if I run select host_name() from the Studio Management query window i get different results depending on which server I am running the Studio Management on. On server1 I get server1 and on server 2 I get server 2, all the while server2 is the active node. I need a different function that will always let me determine the correct server that'll be running the xp_cmdshell...
Edit 2: I guess I could determine the running host inside the command shell itself, but I am curious to see if i can do it (cleaner) from SQL.
I need to expand tempdb database. The users keep getting this error when they try to do a sort: SQL Server message(1510): state 2 Sort failed. Out of space or locks in database 'tempdb'
Also in the error log I am getting these errors: Error 1105, Severity: 17, State: 1 Can't allocate space for object '-641' in database 'tempdb'because the 'system' segment is full. If you ran out of space in Syslogs, dump the transaction log. Otherwise use ALTER DATABASE or sp_extendsegment to increase the size of the segment.
What I am wondering is if expanding tempdb will fix the problem, or is there another fix that I should be looking at.
Any direction you could give me on this would be appreciated. I have very little experience with SQL 6.5
I've created a report with drill downs that are hidden initially. While viewing the report in preview, I'll expand the drill down to see the data.
If I go and print the report, the report is printed as collapsed (which is the initial setting) rather than expanded (which i expanded in the preview).
Is there a way to print in the "what-you-see-is-what-you-get" kinda way expanding and collapsing drill downs?
I posted last year about getting and Expand All/Collapse All link working in reports, and it does work perfectly for on-demand reporting. I was able to get these working using the boolean report parameter and then the Jump to Report option going back to itself changing that parameter.
The issue that I have just discovered is that when a report with these Expand All/Collapse All links are in a report snapshot, clicking those links will cause it to re-render the report from the datasource at the time the link is clicked. This is an issue for one of the datasources we are using because the data is always changing, so when it goes back to re-render the counts and data returned are completely different then they were when the snapshot was first created. As time goes on the data will no longer even be in the datasource since it can only maintain 4 months of data.
Is there another way to get all detail groups to expand/collapse at once that does not require the report to be completely re-rendered from the datasource?
I would like to have a report that globally sets the visibility (or expanding and unexpanding) of a group. Right now, I have the + and - signs for a group, but have to select each on individually in the report.
I am trying to deploy a package to SQL. However, when I open Integration services I can not expand MSDB folder. Error is; SQL Server specified in SSIS service configuration is not present or available.... Login time expired .....(MsDTSSrvr)
I have found post here that says MsDtsSrvr.ini.xml file needs to be changed from
I tried MyServerName - does not work. I also tried value from connecting to Database Engine ( MyServerNameSQL2K5LOCAL) - does not help either.
What am I doing wrong?
Also, I need some documentation on deploying packgaes using File System.
I have saved Copy of the Package as File System location.
When I doubleclick the .dtsx file, Connection Manager holds my local SQL info. Goal is to deploy this to Development and other environments. Can this be handled some other way so I do not have to modify this file on every environment?
Also, this Execute Utility Package says at the top to use this utility to run SSIS on local computer.
So far, help on MSoft sites did not really help me a lot.
this is what I am using:
Microsoft Visual Studio 2005 Version 8.0.50727.42 (RTM.050727-4200) Microsoft .NET Framework Version 2.0.50727
Installed Edition: IDE Standard
SQL Server Analysis Services Microsoft SQL Server Analysis Services Designer Version 9.00.2047.00
SQL Server Integration Services Microsoft SQL Server Integration Services Designer Version 9.00.2047.00
I was wondering if anyone can help me out with this. Is there any way that you can have a document map in SQL Reporting Services expand on load, or if there is a way to programmatically set the Document Map nodes to be expanded when a report is generated.
We have a person who CAN connect to a named instance in SQL Server Management Studio. There is nothing in the log for a failed login for him. However, when he tries to expand the Tables folder under the only user database in the instance, he gets the error: Failed to retrieve data for this request (Microsoft.SQLServer.SmoEnum). Additional Information: An exception occured while executing a Transact-SQL statement or batch. Select permission denied on object 'extended_properties',database 'mssqlsystemresource', schema 'sys'(Microsoft SQL Server, Error:229).
He is trying to expand the Tables folder under a database named ADSALLDB. He can see the folder as well as the other folders (i.e. Views, Synonyms, Programmability,etc.), but can't expand any of them. He can expand the folders under the system databases.
Other uses set up just like him can connect. He is set up with read/write access to the database ADSALLDB. He can expand the system databases.
This is a named instance in a 6 node cluster. SQL Server 2005 SP1 Build Level 2221.
Has anyone had an issue with SQL Server not being able to expandagainst a RAID 5 file system? My current configuration is that theserver is started and stopped using the local system account. I haveonly one database (besides the master, model,etc)on the server. Whathas happend to me several times is that the primary database inquestion try's to expand the main datafile for the database (.mdf). Isetup the database to not expand automatically initially so that I canbe sure that we have enough file system space. Becuase of problems withthe application I decided to automatically expand. The other day thedevelopers came to me indicating that the databse was full and neededto be expanded. Knowing that the database was in automatic expandingmore I was surprise to hear this. I went into EM and attempted toexpand first the log and it would not indicating that it there was anissue in attempting to do so. I have never heard of a database notbeing able to expand. I ran DBCC's, etc and it came up clean. I triedto back the database up to disk and it would not backup. I finally hadto rename the datbase and rebuild it using DTS and scripts. I thoughtI had fixed it only to find out today that it (again) won't expand. Irenamed the datbase and then tried taking an older backup file andrestore it and it would not restore. This problem seems to be relatedto the file system but how I do not know.So, I am ready to run rebuild master but I have sone this before onlyto have this come back on me. I am at a complete loss. In the past Ihave had to rebuild the entire server and database from scratch. Theonly problem is that this has been done 3 times now with no completesolution or explaination. If any of you have seen this type ofbehavior and know whats going on please, please let me know what youthink the case and solution is!
I have a report that is grouping phone calls by "Category" (Outgoing, Incoming, Voicemail, etc). When the report is rendered, each category (along with totals) is shown and the details (each actual call) are hidden. Using toggling, I allow the user to burst open any category to view all of the call details.
I join the query for this report so that even if a category has 0 calls for the day, it is still shown. When expand a category with no calls I get a blank record (as I should, because there are no call details).
The question I have is ... Can I have the toggle be conditional? Can I have the ability to toggle thr group only when there are call details? Can I have the + to the left of the category name not be shown?
Thanks in advance for any help! Merry Christmas!!!
On one of my reports, the +/- for expand/collapse of groups is reversed -- i.e. when the group is expanded it displays "+" and when the group is collapsed it displays "-". The display of the document map is correct.
I have seen a few posts in several forums about SQL Reporting Services 2005 not supporting the expand all / toggle all / or show all feature that many of us require for our report clients. A simple method I use is to create a report parameter names ShowAll. In the properties I have the following: Name is ShowAll / Data type is String / Prompt is Show All? and the Allowo blank value box is checked. In available values I chose Non-queried and in Label and Value I placed Yes - Collapsed and No - Expanded then in Default values I put Collapsed
Then on the field's initial visibility property, I changed the default from collapsed to expression and added the following: