Best Option For Creating A Record With Generated ID?

Apr 28, 2008

Im making a records management type deal where the ID field for a record is what the user is going to be using to identify it.

My question is when the user goes to create a new record what would be the best way to handle generating the ID and showing them the ID, while still being able to scrap the record if they cancel.

Would generating the ID field, creating a new record in the database, giving the user the ID, and then update the record when they finish creating the rest of the fields be the best option.  Then I can detect page redirects and stuff so that I can cancel the record if they havent saved.  Otherwise Im assuming that I would have to have it so that they can find records with no information and delete them.

 Or is there a way that a procedure or SQL server could reserve an ID number for a specific amount of time and release it if the user doesnt finish creating the record?

View 3 Replies


ADVERTISEMENT

Error Message When Creating Replication With Generated SQL Scripts

Dec 5, 2006

Hi all SQL Replication experts :)

I have created my production server as a distributor and a publication on that server. On my backup server I have created a pull subscription. After that I have generated SQL scripts on my backup server so I can create the pull subscription anytime.

To test my script I used sp_removedbreplication 'dbname' to remove replication on the backup server. I then used the generated SQL script to create the pull subscription again. I got this error message

Job 'ProdServName_DBName-BackServName-DBName401A48AE-D8DC-4F29-A610-13916370CD0B' started successfully.
Server: Msg 208, Level 16, State 1, Procedure sp_addsubscription, Line 135
Invalid object name 'syspublications'.

What does this Error message mean and what can I do about it?

Grateful for all answers
Best,
/M

View 1 Replies View Related

Creating An All Option For Parameter Value In GUID Format

Jan 31, 2007

I am working with SRS 2005 SP1 which no longer has the "ALL" option available on parameters. I am trying to create an "ALL" entry in a picklist so it can be used in a where clause for a dataset. I have a dataset with a union statement that creates a list of CRM usersids and names and an entry with a dummy guid with the name "All". Parameter is defined as a string type, with a dataset providing a list of users (label field) and their corresponding GUID value (value field), along with the an "All" entry.

select systemuserid, fullname
from FilteredSystemUser
Union
Select '00000000-0000-0000-0000-000000000000' as systemuserid, ' All' as fullname
order by fullname

The issue I am running into is implementing logic in another dataset referencing my parameter.

All is fine in the where clause if it is structured "where ownerid in (@Users)" but if I try to add logic to check for the "All" option "where (ownerid in (@Users) or @Users = '00000000-0000-0000-0000-000000000000') it errors out.

How do you impement "All" when you're dealing with a GUID type field? Thanks.

View 3 Replies View Related

T-SQL (SS2K8) :: Creating Database Where Each Record Is Required To Have Twin Record In Database

May 12, 2014

,I am creating a database where each record is required to have a twin record in the database.These is a type a value and a type b value and both must be present for the record to be valid.

Customer_ID, Order_Type, Product_Code
54, a, 00345
54, b, 00356

Is this something that would have to be done programmatically, or is it possible to create a constraint of some sort to ensure this?

View 8 Replies View Related

Not Able To Create A DB Diagram In SQL Server 2005. No Menu Option For Creating A DB Diagram??

Apr 23, 2007

I have created a database with several tables. I want to create a database diagram to show the relationshipbetween the tables. Below are the steps from the SQL Server 2005 documentation on how to create a database diagram. The problem is that when I right click on the Database Diagrams folder I am only given two options. They are:"Working with SQL Server diagrams" and "Refresh"There is no menu choice to create a new database diagram. Can anyone tell me what the problem here is?
 
To create a new database diagramIn Object Explorer, right-click the Database Diagrams folder or any diagram in that folder.
Choose New Database Diagram on the shortcut menu.
The Add Table dialog box appears.
Select the required tables in the Tables list and click Add.
The tables are displayed graphically in the new database diagram.

View 1 Replies View Related

Problem In Creating New Record

Jun 5, 2007

hi all,
I am getting a problem when creating a record in my database

when i click on new button to create a record it is throwing a error message:

Fatal error: could not get the next record number
(ODBC call-failed.-3146)
7411-37000[microsoft][Odbc sql server driver] [sql server] server 'xxxx' is not configured for Dataaccess. ODBC. recordset
3146-odbc--callfailed DAO-recordset.

please some one help me.

Shashidhar.

View 1 Replies View Related

Entity Framework: No Support For Server-generated Keys And Server-generated Values

May 23, 2008

Hello

I tried the Beta 1 of the service pack 1 to .net 3.5. If I try to add an entity (and try to save this), I get the Exception "No support for server-generated keys and server-generated values".

How can I add entities to my Sqlce- database?

I tried to give the id- column (primary key) in the database an identity, another time without identity, only primary key --> none of them worked. I always get the same error.

What do I have to change to make successfully a SaveChanges()?

Thanks for your help,
Gerald

View 21 Replies View Related

Creating A Trigger To Check Before Deleting A Record

Jun 12, 2008

I am using the tables created by the aspnet_regsql.exe tool for security.  Basically, I need to ensure that an account named Administrator is never deleted.  I also have a role named administrator, and I need to make sure that Administrator is never removed from the administrator role.Can I create a trigger to ensure that the Administrator is never deleted and that the Administrator is never removed from the Administrator role?  I know it will probably be two separate triggers: one on the aspnet_users table and one on the aspnet_usersinroles table.Thanks a lot for the help!

View 1 Replies View Related

Creating A Trigger That Emails When New Record Is Added.

May 21, 2007

I'm hoping one of you will be able to help me because I haven't had very good luck finding any information on this.



I'm kind of new to SQL, but I'm learning as much as I can.



I created a web form that sends a new record to a SQL 2005 table I setup.



This all works exactly as it should, but I would like to have an email sent out every time a record is added to this table.



I have SQL Mail setup and I ran a test and it worked, but I can't seem to find any info on how to create a trigger that will send an email to me when a new record is added to the table.



My Database is called Engineering

The table is called ESSPartNumLog



And I have the following Columns that I would like to send in my email..



ESSSequence (PK,int, not null)

MaterialType (nvarchar(255, null)

ESSPrefix (nvarchar(255, null)

PartDescription (nvarchar(255, null)

Project (nvarchar(255, null)

PM (nvarchar(255, null)



Any ideas, or can you point me in the right direction?

View 1 Replies View Related

Creating A Record Number That Auto Generates In SSIS

Jan 8, 2008

Can anyone help me figure out how to set up a new table using SSIS with a record field that will generate a unique number? The record number is also the primary key in the table. I did this about a year ago with a bit of help, but once you get the language right and initiate the creation, the text for defining the table is no longer available. I have seen a lot of references for MySQL and MS SQL 2000 and an AUTO_Generate or a UNIQUE ID. None of this works within MS SQL 2005 in SSIS.

Thanks!
Jim

View 8 Replies View Related

Creating One Flat File Per Record In The Data Flow

Nov 30, 2006

I have a table that holds in each record an image (varbinary(max) actually), a text reference for the image and a MIME type for the image. I need to read this table and for each record that has been created since the last run, I need to create a file with the image as the content, the mime type as the file extension and the text reference as the file name. There will be one file created per record found by the data flow source.

I was assuming that I could use the flat file destination and manipulate the file naming using the contents of each record in the flow but am completely stumped on how to achieve this.

Does anyone have any ideas?

thanks

View 3 Replies View Related

Creating External Record Of All Subscriptions And Report Names

Jan 9, 2008

hi

i have been tasked with creating a record of all the reports ( 200+ ) within each folder ( bout 20 ) and all the subscriptions (including parameters) for our SSRS i was wondering what the best way of doing this was (SQL query?)

i have tried creating a site map with visio but im struggling to get the subscriptions details

anyone done this before (or have any ideas) i would be very grateful

thanks

Jake

View 5 Replies View Related

In SqlServer Management Studio Express, Server Type Option Is Greyed Out, Also Publication Option Missing

Apr 27, 2008

Hi everyone In my SqlServer Management Studio Express, on start up it shows the server type option, but greyed.So that value is fixed to database engine. ( I'm trying to work on an SqlServer Compact Edition database through the SSMStudiothat's why I'm trying to get this to change.)Besides, after I connect i go to the Object Explorer, expand the server node, and go to Replication.When i expand replication, i get the "Local Subscription" option, but nothng for Publication.( I want to work on Merge Replication, that's why I desparately need Publication to work)Am i missing something here? I did not install SqlServer separately, I only have what comes bundled with the Visual Studio  2005 Setup.

View 2 Replies View Related

Creating Hierarchical Flat File From Multiple Record Types

May 1, 2008

I'm using SSIS to import seven flat files (each containing a different record type) into a staging database. This part was easy.

Now I need to export the records from all seven tables into a single flat file structured in a nested hierarchy using common keys. (This format is required by the vendor for loading data into a new system).

I could use some ideas on the data transformations needed to combine all seven record types into an hierarchical record set which can then be written to my Flat File Destination. I'm currently looking at an article on SLQIS.com ("Handling Different Row Types In The Same File") which seems close to what I need, but they are importing (ref: www.sqlis.com/54.aspx ). I'm not sure if I should just reverse this for export or use something different. Any comments are appreciated.

Diagram of Record Hierarchy

typeA (parent key, ...)

typeB1 (parent key, childSet key, date, ...)

typeB2 (parent key, childSet key, ...)

typeC (parent key, childSet key, ...)
typeD (parent key, childSet key, ...)
typeE1 (parent key, childSet key, date, ...)

typeE2 (parent key, childSet key, ...)


The record types B1 through E2 form a complete set. Each set has it's own unique child-set key. There may be one or more sets for each typeA record (although it's possible that typeE records don't exist in the most recent set).

View 3 Replies View Related

SQL 2012 :: Creating Snapshot From Mirror Database Failed - Could Not Redo Log Record

Sep 1, 2015

Process to create snapshot failed (twice per day snapshot of the database is being created for some people to work on). Morning snapshot worked fine but the afternoon one failed. The snapshot is being created from Mirror database. I used this code:

CREATE DATABASE [DB_snapshot] ON
(name = N'DB',filename = N'D:SnapshotDB.SQLSnapshot' )
,(name = N'indexes',filename = N'D:SnapshotDB_indexes.SQLSnapshot' )
AS SNAPSHOT OF DB

And the error message i get

Msg 1823, Level 16, State 6, Line 1
A database snapshot cannot be created because it failed to start.
Msg 1823, Level 16, State 7, Line 1
A database snapshot cannot be created because it failed to start.
Msg 3456, Level 21, State 1, Line 1
Could not redo log record (202011:19306:2), for transaction ID (0:0), on page (1:1823948), allocation unit 281474979397632, database 'DB_snapshot' (database ID 6). Page: LSN = (201954:220201:1), allocation unit = 281474979397632, type = 1. Log: OpCode = 4, context 18, PrevPageLSN: (202010:23679:1). Restore from a backup of the database, or repair the database.
Msg 3313, Level 21, State 1, Line 1

During redoing of a logged operation in database 'DB_snapshot', an error occurred at log record ID (202011:19306:2). Typically, the specific failure is previously logged as an error in the Windows Event Log service. Restore the database from a full backup, or repair the database.

What might be causing this error? Mirroring seems to be working OK. status is "Synchronized"

View 1 Replies View Related

SQL 2012 :: Configuring Memory Per Query Option And Index Create Memory Option

Feb 10, 2015

So I started a new job recently and have noticed a few strange configurations. Typically I would never mess with min memory per query option and index create memory option configuration because i just haven't seen any need to. My typical thought is that if it isn't broke... They have been modified on every single server in my environment.

From Books Online:
• This option is an advanced option and should be changed only by an experienced database administrator or certified SQL Server technician.
• The index create memory option is self-configuring and usually works without requiring adjustment. However, if you experience difficulties creating indexes, consider increasing the value of this option from its run value.

View 3 Replies View Related

TOUGH INSERT: Copy Sale Record/Line Items For Duplicate Record

Jul 20, 2005

I have a client who needs to copy an existing sale. The problem isthe Sale is made up of three tables: Sale, SaleEquipment, SaleParts.Each sale can have multiple pieces of equipment with correspondingparts, or parts without equipment. My problem in copying is when I goto copy the parts, how do I get the NEW sale equipment ids updatedcorrectly on their corresponding parts?I can provide more information if necessary.Thank you!!Maria

View 6 Replies View Related

Aspnet_regsql.exe And Generated SQL

Jun 21, 2006

Where is the sql generated by aspnet_regsql.exe saved?

View 2 Replies View Related

How To Get Generated Identity Value?

Oct 1, 2004

Hi,

How can I retrieve generated identity value after insert a row into table in case I can identify inserted row?

(the INSERT statement is dynamic constructed and queried from data access layer, not in stored procedure)

Thanks,

View 3 Replies View Related

How To Get Generated Identity Value?

Oct 3, 2004

Hi,

How can I retrieve generated identity value after insert a row into table in case I can identify inserted row?

(the INSERT statement is dynamic constructed and queried from data access layer, not in stored procedure)

Thanks,

View 1 Replies View Related

Auto-generated Key

Feb 7, 2007

Hello,

I've a problem with auto-generated key. In my parent table, some lines have been deleted. I would like to add new lines with the same content in order to restore my database, but I cannot decide on the id value which is an auto-generated key. Is there a solution to set an auto-generated key with a specific value ?

Thank you in advance,

regards,

mathmax

View 3 Replies View Related

SQL Generated Tables

Sep 27, 2007



Suppose I want to generate a table as below

No. Col1 Col2
1 100 Alan
2 110 Alan
3 120 Alan

In Column I there is a sequence of numbers from 1 to 3 with a step of 1
In Column 2 there is a sequence of numbers from 100 to 120 with a step of 2
In Column 3 there is a name that is repeated accross the whole column

Can I generate such a table with just a single SQL Statement . I don't see any reason why it should not be possible. We know the logic to generate all the numbers of every row. It would be possible using a while loop , but that is be tedious and I am looking for a better way.

One application I can think of is, Suppose I want to find out all deleted primary key ids from a table or say if I have a set
(1,2,3, 7,8,9) , and wish to know the missing numbers in the range 1 to 9. If an sql like above is possible I could use it in a left join to get me the desired output.

Could anyone tell me if it is possible and if not , why not ?

Thanks,
Alec

View 6 Replies View Related

SQL Query Generated.

May 2, 2008

Hi,

Is there any way to look at behind-the-scene SQL query that gets generated by SSRS engine to pull the data out of the data source (particularly SQL Server).

So far, I only know that you can see the query generated by semantic query engine by changing trace option in configuration file.

Thanks and Regards,
XL

View 2 Replies View Related

Report Is Being Generated

Aug 28, 2007

Hi
I have a windows application. I am using following code right after setting the LocalReport ReportPath. Report rendering is too slow if use following line of code and Report viewer does not show spiny and the text that says €œReport is being generated.€?

Me.ReportViewer1.SetDisplayMode(DisplayMode.PrintLayout)
Me.ReportViewer1.ZoomMode = ZoomMode.Percent
Me.ReportViewer1.ZoomPercent = 80

Please advise how can make it fast and show spiny.

Thanks in advance.

View 8 Replies View Related

Report Is Being Generated But Never Does...

Aug 17, 2006

I have created a report and deployed it successfully to a seperate machine with SSRS on. Both my dev machine and the SSRS machine are in the same workgroup. I can then Browse to the Report Manager though IE and click & run the report (The connection is using integrated security). The report requires a single parameter to be entered which once done works successfully. The report has a single table, an inbedded image and a few static fields in the report header.

If I however add a report viewer control to an aspx test form all is not well. As soon as the page opens I am prompted to enter the parameter which is good news as it shows there has been some communication with the SSRS metabase. I then click the view report button. Using Profiler I have proved that the report Stored Proc. is running with the correct parameter value. The report viewer however seems to hang and only displays "Report is being generated" without displaying the results. It does this even with a timeout set of 1000ms.

I don't think this is a security issue as both the Report Manager works and the test form prompts me for the parameter and effectively runs the report SP. I can only assume it is a problem with returning the report to the browser.

Does anyone have any insight?

Regards

Anthony Kay

View 3 Replies View Related

Id Getting Generated Differently

Apr 13, 2006

Hi,

I created a PDA application with a database, which has a table with a uniqueidentifier field and primarykey.

While doing the bulk insert from dataset into sql mobile database, It is inserting the record but it is not inserting the id which was entered into the sql server 2005 database, instead the id by creating a new id and the code is as below.

conAdap = new SqlCeDataAdapter(strQuery, conSqlceConnection);

SqlCeCommandBuilder cmdBuilder = new SqlCeCommandBuilder(conAdap);

conAdap.Fill(dsData);

int r =conAdap.Update(dsData);

Please help me.

Thank you,

Prashant

View 1 Replies View Related

My Report Can't Be Generated

Jan 16, 2008



Hi,

I have a report which doesn't work. It has a datatset based on a store procedure. The store-procedure take 10 to 50 second to execute, depending on the parameters.

But, I can't never see my report as i wait more than 10 minutes and it's never generated.

So, I have think that maybe it could be because of the matrix inside the report, so I have try to create another report which have the same dataset but with nothing inside, just a textbox, and it doesn't work too !!
So now, i'm very disapointed and I don't know what to do !
Someone can help me please ? It's very important.

Thank you.

View 2 Replies View Related

How To Create An Copy Of A Certain Record Except One Specific Column That Must Be Different && Insert The New Record In The Table

Sep 1, 2006

Hi
I have a table with a user column and other columns. User column id the primary key.

I want to create a copy of the record where the user="user1" and insert that copy in the same table in a new created record. But I want the new record to have a value of "user2" in the user column instead of "user1" since it's a primary key

Thanks.

View 6 Replies View Related

Ways To Make This Work: Several Selectable Related Record For One Main Record.

Apr 6, 2007

Hey all!



Sorry for the less then descriptive post title but I didn't find a better way to describe it. I'm developing an app in the express editions of VB and SQLserver. The application is a task/resource scheduler. The main form will have a datepicker or weekly overview and show all tasks scheduled per day. The problem is, I've got one or more people assigned to tasks and I wonder what's the best way to design this. Personally, I'd go for one Task table, a People table and a table that provides a link between them (several record per task, one for each person assigned linking TaskID and PplID). However, I don't see a nice way of showing this data to the end user, allowing him to edit/add etc on ONE screen.

To fix that the only way I see is just add columns to the Task table for every person with select boxes. This way everything can be done on one simple screen. This obviously does present some future issues.

On top of this, which people are available on a day varies and there should be an option to allow a user to set who is available on a specific day. Which would lead me to my first idea and add another table that would provide this. but then I'm having design issues again for the form.



I'm kinda stuck atm, can anyone shed some light on this. I'm sure there is an elegant way of doing this but I'm failing at finding it.



Thanks in advance,

Johan

View 5 Replies View Related

Query Timeouts When Updating A Record Retrieved Through A Websphere JDBC Datasource - Possible Record Locking Problem

Apr 7, 2008

Hi,

We're running a Sage CRM install with a SQL Server 2000 database at the back end. We're using the Sage web services API for updating data and a JDBC connection to retrieve data as it's so much quicker.

If I retrieve a record using the JDBC connection and then try and update the same record through the web services, the query times out as if the record is locked for updates. Has anyone experienced anything similar or know what I'm doing wrong? If I just use DriverManager.getConnection() to establish the connection instead of the datasource, and then continue with the same code I don't get these record locking problems. Please find more details below.

Thanks,
Sarah

The JDBC provider for the datasource is a WebSphere embedded ConnectJDBC for SQL Server DataSource, using an implementation type of 'connection pool datasource'. We are using a container managed J2C authentication alias for logging on.

This is running on a Websphere Application Server v6.1.

Code snippet - getting the record thru JDBC:


DataSource wsDataSource = serviceLocator.getDataSource("jdbc/dsSQLServer");
Connection wsCon = wsDataSource.getConnection();


// wsCon.setAutoCommit(false); //have tried with and without this flag - same results

Statements stmt = wsCon.createStatement();


String sql = "SELECT * FROM Person where personID = 12345";
ResultSet rs = stmt.executeQuery(sql);


if(rs.next()){
System.out.println(rs.getString("lastName"));
}

if (rs != null){
rs.close();
}
if (stmt != null) {

stmt.close();
}
if (wsCon != null) {

wsCon.close();
}

View 1 Replies View Related

SSIS: Multi-Record File Extract With 9 Record Types

Feb 26, 2008

I am attempting to create a multi-record file (as described in my last thread) and have found the following set of instructions very helpful:
http://vsteamsystemcentral.com/cs21/blogs/steve_fibich/archive/2007/09/25/multi-record-formated-flat-file-with-ssis.aspx

I have been able to create a sample file with two of my record types.

I now need to build on this further, because I have 9 record types in total that need to be extracted to a single flat file.

does anyone have any ideas how I might extend the example above to include more record types or know of another means of achieving this?

Thanks in advance for any help you might be able to provide.


View 3 Replies View Related

TableAdapter Class Not Generated

Aug 2, 2006

I created a new DataSet object using the
wizard and had no probs, it's very straightforward.  I created a
GetProducts() method and also added a GetProductCount() method.  I
read somewhere that when the DataSet is saved, it will generate the
TableAdapter classes and store them in the project nested under the
DataSet object.  This isn't happening, the files aren't there and
yes I'm displaying all files.  There *is* however the TableAdapter
class but it's in not in the project, it's a temporary file w/ the
following path:
   
C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET
Fileswebsitef38f8b5500014aeSources_App_Codepw_products.xsd.72cecc2a.cs.

I saved the DataSet several times, compiled the entire solution and
even closed the solution yet this temporary file isn't getting saved
where it should be.  Does anyone have any ideas abt this? 
I'm eager to start developing my DAL and def want to use these
TableAdapter classes.

Thx in advance,
-Pete

View 2 Replies View Related

Generated Sprocs Of VS2005

Oct 24, 2006

Can someone explain the generated sprocs of VS2005 if one column can be nullableDependentOfSeqID = @Original_DependentOfSeqID OR ((@IsNull_DependentOfSeqID = 1) AND (DependentOfSeqID IS NULL))In VS2003 the generated sprocs would beDependentOfSeqID = @Original_DependentOfSeqID OR ((@Original_DependentOfSeqID IS NULL) AND (DependentOfSeqID IS NULL))Which is the best? 

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved