How To Customize Auto Generated Userid?

Feb 3, 2008

Hello everyone,
i have a web form to take user details.
as soon as the submit button is clicked the form is submitting and
the new row is being added into the sqldatabase.
its fine ..
but in the newly added row, i want the user id(primary key and auto generating) to display in different manner.
in mytable column(userid),instead of userid auto displaying 1,2,3,4 ...
i want it to display in this way.these are all primary keys of rows added.

todaydate-username-1 eg(2.2.2008-jack-1)
todaydate-usernaem-2 eg(2.2.2008-zak-2)
todaydate-usernaem-3 eg(2.3.2008-leme-2)
any idea how to achieve this.?
thanks.
jack. 
 
 
 
 

View 9 Replies


ADVERTISEMENT

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

How To Use Both Auto Generated Id And A Guid In Database

Oct 22, 2006

I downloaded the AdventureWorks OLTP Schema and am trying to use some of the design concepts that are used in this example but I don€™t quite understand some things.

First there is a column named rowguid, at the moment I assume that this is a GUID. If this is wrong most likely my next question will make no sense.

Second if that is indeed a guid all the tables have another id; example would be Employee table would have employeeid and rowguid, why do this? My best guess is that you would use the guid to easily insert (linked/sync) data into multiple tables without needing to retrieve the id from the table that was first input into. My scenario would be inserting an employee; to insert an employee you need to create a row in the employee, contact and address tables and for ease you would use the guid to link these rows. But if this is the case wouldn€™t there be sync issues that would arise?

If my guess is totally off please correct me also if anyone can direct me to some good resources that cover database design.

The schema can be downloaded at http://www.microsoft.com/downloads/details.aspx?familyid=0F6E0BCF-A1B5-4760-8D79-67970F93D5FF&displaylang=en#filelist

Thanks for any help.

View 1 Replies View Related

Custom Auto Generated Sequences With Server?

Aug 31, 2014

can i create Custom Auto-Generated Sequences with SQL Server like DD-0001,DD-0002,DD-0003...... to DD-000........

View 1 Replies View Related

Redefining An Auto-generated Primary Key Constraint Name

Jan 9, 2007

Hey there :)I'm using Ruby on Rails to create a migration of a legacy database onan MS SQL Server. I'd like to name my constraints myself, such as'pk_authors', but in the cases where a table has an auto incrementedIDENTITY(1,1) id field, Rails takes over and adds the primary keyitself when creating the table.This is fine, except then the constraint gets a name like'PK__authors_384934' which is not very intuitive or easily remembered;)I'd like to just throw in an 'ALTER TABLE authors...' statement justafter that table has been created, but I'm not sure how to go aboutrenaming the auto generated constraint since the name it gets ispartially random. Is there any way to indirectly refer to theconstraint like 'RENAME PRIMARY KEY CONSTRAINT ON authors TOpk_authors' or something like that, so that I can rename theconstraint?Thanks in advance,Daniel Buus :)

View 9 Replies View Related

Help - Deleting Existing Auto-generated Primary Key

Feb 7, 2007

hi guys,

just a question regarding database design

i have a table with an auto-generated primary key but the problem is this:

say i have 4 records,so logically they'll be numbered 1 to 4.so the problem is whenever i delete all records and add new ones,the numbering will start from 5 and not 1 again.

how do i remedy this?

thanx

View 5 Replies View Related

SQL 2012 :: Drop All The Auto Generated Column Statistics?

Dec 29, 2014

My question: Is it okay to drop all the auto generated column statistics? (for the following scenario)

- I am cleaning up unnecessary objects (tables, unused indexes, overlapping statistics etc) from databases and found out there are more than 1400 auto generated column statistics on one database (lets call it A).
- Database A was used to be our reporting database but from last several years we are using database B for reporting. DB A has all the historical data while DB B only has valid records.
- We are updating all the column statistics with full scan nightly on database A and it is talking almost 2.5 hours to do that. Now I want to drop all the "unnecessary" statistics those were created when DB A was reporting database and they are no longer in use. There is no way to know the creation date of the column statistics that I know of. Statistics "last update date" is of no use because of our nightly job. So I was thinking of dropping all the auto generated column statistics and let the sql server create as it needs from now.

View 0 Replies View Related

How To Extract Auto-generated Int Identity PK Field Value Immediately After It's Made ?

Sep 12, 2007

Ok, let's say that I do a following inline INSERT statement..... 
INSERT INTO Car ( carMake, carModel ) VALUES ( 'Honda', 'S2000' )
When I do this, a carId int value will automatically be generated because it is the Car table's PK and is an int identity.  How do I obtain this value so I can immediately use it in let's say, the following example.
INSERT INTO Person ( carId ) VALUES ( @carId ) ..... where @carId is the value I need
Maybe you would say I should do something like.....
SELECT carId FROM Car WHERE carMake = 'Honda' AND carModel = 'S2000'
However, let's assume that the carMake and the carModel fields are NOT unique.  I'm sure there's an easy way to extract the new identity value (maybe even in the same query) as the INSERT, but I just don't know how.
Thanks.

View 10 Replies View Related

SQL 2012 :: Remove Auto Generated Statistics After Adding Index

Nov 21, 2014

We have implemented a very small reporting database which has a main table that started off small and has now grown to around half a million rows. Initially, there were no indexes on the table apart from a clustered index, but as the data has grown, performance has dropped and so we have added a number of indexes. This has resolved the performance issues.

Before creating the indexes SQL Server had auto created a number of statistic objects (_WA_Sys_000... etc). After creating the indexes, new statistic objects where created for the new indexes. In some cases, there are duplicate statistics (auto and index) for the same columns.Should I go through and drop the duplicate auto statistics? Will having duplicates cause issues at all?

View 2 Replies View Related

Using Membership UserId Guids With SqlParameters (Membership UserId Guid)

May 7, 2008

In my site, when a user registers, I need to create rows in additional tables besides aspnet_Users. So, I need to be able to pass the generated userId guid to subsequent SqlCommands. I'm having a terrible time with this. What's the correct way to set up a SqlParameter so that it will accept a guid? I keep getting this error: "Conversion failed when converting from a character string to uniqueidentifier."
I've tried creating the parameter both with and without a SqlDbType.
cmd.Parameters.AddWithValue(paramName, guid);
and
SqlParameter p = new SqlParameter(paramName);p.SqlDbType = SqlDbType.Guid;cmd.Parameters.Add(p);
and I get the same error either way.
Driving me nuts! Any help appreciated.

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

How To Customize The Primary Key Id

Jan 10, 2008



Hi to everyone,

By the way, I'm not sure if, I am in the right related forum to address this questions.
My problem is how to customize a primary key id of the table.
Example. I have a two tables customer and product, and my customer table has a customer id. I want to customize my customer id, which for example the starting id will starts CUS-0001...CUS-002 and so on.
And same also to my product table, product id will starts PROD-001..PROD-002 and so on. the digits of my id's is auto incremented.
Thank you for the time of reading my questions.
Your response is highly appreciated..

View 3 Replies View Related

SQL 2012 :: SSMS Auto-recovery / Auto-save New (unsaved) Queries

Feb 16, 2014

Since upgrading from SQL Server Management Studio 2008 R2, I've noticed that it no longer autosaves queries that have not been manually saved first. If a file has been manually saved the autorecover files end up in the following directory:

%appdata%MicrosoftSQL Server Management Studio11.0AutoRecoverDatSolution1

However, I have ended up in the situation where I have unsaved queries when my computer has crashed and have not been able to recover them.

I have also found references to .sql files stored in temp files in the following directory, but the files here seem to be very haphazardly caught:

%userprofile%AppDataLocalTemp

View 2 Replies View Related

Sendmail Task - How To Customize ?

May 15, 2007

I have a sendmail task following a data flow task. How can I set "To" attribute on the sendmail task before running it ? for example, read a config table and detemrine who the mail should be sent to...

View 1 Replies View Related

Customize Report Manager

Apr 30, 2008

Hi,
Is it possible to customize the report manager web site so that I can set the report output format to excel by default.
Currently, to get the excel report user has to first select the report criteria and then click the "view report" button which renders the report in HTML format and then only the export to excel option appears.

Is there a way we can get the report exported to excel in one go.

Thanks,
Rajiv

View 1 Replies View Related

Customize Report Manager

Sep 17, 2007

I would like to use Report Managers interface for choosing reports.
But all of the reports uses different dsu(datasourceuser) and dsp(datasourcepassword) depending on which user that is logon.
I would like to call the interface from a webapplication(where they have the current dsu & dsp).

Is there a way to customize Report Manager to save the dsu & dsp so users don't have to login for each report?
Or could I make a clever transformation from the Windows userid?

Or any other ideas??

View 1 Replies View Related

Using InScope() For Customize Subtotal

Jan 22, 2008

Hello All:

I have the following data:

2000 2001

Child Teen Adult Child Teen Adult
Region1 25 40 35 33 55 12
Region2 50 10 40 20 10 70

Total 75 50 75 53 65 82

and I need the following data

2000

Child Teen Adult Child%
Region1 25 40 35 25/(25+40+35)
Region2 50 10 40 50/(50+10+40)

Total 75 50 75 75/(75+50+75)

I was able to get the Child% column and Total row, except for the cell (75/(75+50+75) ) using InScope() operator.
Can any one help me in this regard.


Thanks,
Vishnu

View 4 Replies View Related

Customize Report Filters

Dec 12, 2007



Can I customize the report filters?

I need to use the data from another table (in a Drop Down control) to filter the data of my report instead of having a simple textbox.

How can I do this?

View 7 Replies View Related

Transact SQL :: How To Customize Where Statement Based On UDT

May 20, 2015

Display customized data based on customized where statement from UDT.

The UDT is a parameter inside of a stored procedure.

Problem:

A parameter from a stored procedure is
@communication communications readonly

This parameter is a User-Defined Table Types (UDT) It contains criteria based on end-user's selection from a filtration functionality from a webpage.

Four example of filtration critera based on four end-users' selection that is located inside of a table below.

Each UDT table contains different criteria:

Number Criteria
------ --------
1 Phone
3 Email

Number Criteria
------ --------
1 Phone
2 Cellphone
3 email

Number Criteria
------ --------
4 None

Number Criteria
------ --------
2 Cellphone
1 Phone

Is it somehow possible to use the criteria's value as a column name in the where statement? I want to filtrate the data of the table datatable based on id, name and the UDT's criteria.

I was enable to apply the criteria inside of a variable by looping the UDT's table but the next thing is to paste it in the where statement after "id=1 and name" below

select *
from datatable
where id = 1 and name = 'Cost'

How should I do it?

[URL] .....

create table datatable (id int,
name varchar(100),
email varchar(10),
phone varchar(10),
cellphone varchar(10),
none varchar(10)
);

[Code] .....

View 4 Replies View Related

Specifying Different Stylesheet In URL To Customize ReportManager Interface

May 7, 2007

Thanks in advance to anyone who can provide insight into this...



I am trying to specify a different stylesheet (other than ReportingServices.css) in the URL for running the ReportManager application; I am using the "rstylesheet=<stylesheetname>" parameter in the URL. However, it seems that no matter which format of stylesheetname I use (i. e, just the stylesheet file name with no extension, stylesheetname + ".css" extension, "/reports/styles/<stylesheetname>", etc.), the ReportManager application only uses the built-in ReportingServices.css stylesheet.



Is there some "magic" to specifying the name of an alternate stylesheet with the "rstylesheet" URL parameter, or does this just not work?



Thanks again!

View 12 Replies View Related

Customize Report Parameter Layout?

Nov 7, 2007

Hi,

I'm trying to deal with a way to change the report parameter's default layout.

currently it seems to default to two columns, that's fine until you have a large screen and the "View Report" button is all the way to the right and you have a big chunk of whitespace.

For Example:
Parameter 1 Parameter 2 <View Report>
Parameter 3

I'd like it to show up instead as:
Parameter 1 Parameter 2 Parameter 3 <View Report>


anyone ever tried this before?

View 4 Replies View Related

Customize The SQL Reporting Services Page

May 5, 2008

Is it possible to customize the SQL Server Reporting services home page to add our company Logo and custom title etc...?
Thank you,


View 3 Replies View Related

Customize Prompt Message For Stored Procudure

Jul 23, 2005

Hello all,I have a stored procedure that prompts the user for beginning date andending date to run a monthly report. The prompt saysEnter_Beginning_Date and Enter_Ending_Date. I want the prompt to sayEnter Beginning Date (Example:1-1-2003) or something like that. Isthere a way to do this?CREATE PROCEDURE dbo.MonthlyReport(@Enter_Beginning_Date datetime,@Enter_Ending_Date datetime)AS SELECT incident, @Enter_Beginning_Date AS BeginningDate,@Enter_Ending_Date AS EndingDate, COUNT(*) AS OccurancesFROM dbo.IncidentWHERE (DateOccured BETWEEN @Enter_Beginning_Date AND@Enter_Ending_Date)GROUP BY incidentGO

View 6 Replies View Related

Reporting Services :: Customize Column Grouping

Jul 6, 2015

I am working on one of the report. where I need to move the amount across column group.

My data is like this

Project Amount CurrentFiscalMonth DelaybyMonth
A 10 Jul 0
B 20 Aug 2
C 10 Sep 0

Report will be sum up the amount at CurrentFicalMonth grouping on column

But, if the Project is being delayed say by as per the example its 2 months than the amount should be moved from Sep to Oct column for the particular project. User has done it using the Offset function in excel.

Fiscal month starts at July and ends at June. and data source is SSAS cube.

View 4 Replies View Related

Auto Increment Auto Non-identity Field

Jan 23, 2004

I have an MS SQL Server table with a Job Number field I need this field to start at a certain number then auto increment from there. Is there a way to do this programatically or within MSDE?

Thanks, Justin.

View 3 Replies View Related

How To Customize View Of SQL Server Enterprise Manager On Startup?

Jul 23, 2005

Hi,I've managed to get a couple of shortcuts on my desktop that log meright into SQL Query Analyzer for whichever particular database I want(using the isql.exe command line options). Now, I want to do a similarcustomization for the SQL Server Enterprise Manager. I want to be ableto open SQL Server Enterprise Manager and have it pop me all the waydown into my particular database/tables view -> e.g. "Microsoft SQLServersSQL Server Group(LOCAL) (WindowsNT)DatabasesmyDatabaseName". I'm hitting a local db server...I've tried saving new consoles (.msc files), but that just doesn't seemto do anything. I've tried using bookmarks, also, and they just don'tdo anything at all when I select them.Any ideas??

View 1 Replies View Related

Reporting Services :: How To Customize SSRS Bar Chart Report

Jul 23, 2015

I have a requirement associated with SSRS bar chart.

Data in my DB is like shown below:

A
B
C

Opt1

Data1
10
Data2
20

Opt2

Data1
30
Data2
40

Opt3
Data3
50

Now I would like to build up a bat chart which should have:

Legends: Opt1, Opt2, and Opt3

Categories: 
Data1(showing bars with scores as 10 and 30),
Data2 (showing bars with score 20 and 40), 
Data3 (showing bar with scores 50 only)

View 3 Replies View Related

Customize Template.ini To Upgrade From Msde To Express Edition?

Jan 29, 2007

I need to create the script to upgrade the current named instance of sql 2000 desktop engine to sql server 2005 express edition. I am having difficulty preparing the template.ini and would appreciate help.

[Options]
INSTANCENAME=MY_INSTANCE
SQLBROWSERACCOUNT=NT AUTHORITYNETWORK SERVICE
SECURITYMODE=SQL
SAPWD=music
UPGRADE=SQL_Engine
SQLBROWSERAUTOSTART=1
RSCANINSTALLDEFAULT=0
RSCONFIGURATION=FilesOnly
RSSQLLOCAL=0

I get an error that this file is invalid..Any clues? I am trying to upgrade existing instance of msde 2k to sql express 2005 and uses sql authentication

View 2 Replies View Related

Problem : Can't Customize Style Sheets For HTML Viewer

Mar 15, 2007

Hi ,

Yesterday I Customize Style Sheets for the report manager. Today I tried to customize Style Sheets for HTML Viewer but it doesn't works. I have done all that steps :

- I include the <HTMLViewerStyleSheet> setting into the <Configuration> selection of the rsreportserver.config file and then specify the style sheet I want to use : <HTMLViewerStyleSheet>HtmlViewer2</HTMLViewerStyleSheet>

- My rsreportserver.config file is into the C:Program FilesMicrosoft SQL ServerMSSQL.2Reporting ServicesReportServer folder.

- The style sheet HtmlViewer2.css is located in the C:Program FilesMicrosoft SQL ServerMSSQL.2Reporting ServicesReportServerStyles folder.

I'm using SQL Server 2005.

Can someone Help me ? I have been trying change the style of the toolbar all the day and i start to be desperate !

Thank you.



View 1 Replies View Related

Customize Database Admin Activities By Creating New User Group?

Aug 17, 2012

The requirement is to customize database admin activities by creating new user group.

Need to create a group of user / dbauser1 which will have restriction in seeing the data but they should be able to alter database - add / remove the data file , increase or decrease the data file space when required.

This requirement came we wanted to create a new dba group they should not be able to any user data / any table but increase / decrease / add / modify space etc.

View 1 Replies View Related

SSRS How To Customize The Report Models Created For Specific Users

Jan 3, 2008

hi,

I am new to SSRS. I am doing some report models for Ad-hoc reports. Im my database i have some users and their roles according to my requirement. User should only see the particular reports if he have privilege. how to customize...

User will access Report Builder to do adhoc report.

For example
I have 5 report Models
rptModel1
rptModel2
rptModel3
rptModel4
rptModel5

In my data base there are 3 users.
user1 have privilege to view rptModel1, rptModel3
user2 have privilege to view rptModel4, rptModel5
user3 have privilege to view rptModel2, rptModel5

When Particular user access the report builder, There i want to show only that particular Report models...
is there any posibilities to do this please Help me.

Thanks in Advance...


-Kannan
kannan1017@gmail.com

View 5 Replies View Related

Customize Database Maintenance Using SSIS (Select Databases Based On Status)?

Mar 7, 2008

I want to customize database maintenance to run only on selected databases based on their status in sys.databases, without having to statically select them in the GUI.


I'm trying to write an SSIS package that will do the following:


1. Query for a list of databases that are not read-only or recovering, etc.
2. Perform database maintenance tasks (e.g., rebuild indexes) on those databases.

I'm doing this because the database maintenance tasks do not provide a way to select databases based on criteria or a SQL query filter.

My package includes an Execute SQL task to get the list of databases, a Foreach loop container to loop through the databases, and then...this is where I get stuck. I can't use the existing maintenance tasks (Rebuild Index, Update Statistics, etc.) because I don't know how to provide an input variable for the list of databases. I'd rather not write dynamic SQL to generate commands for each database object.

Does anyone know how to do this?

Thanks much.

David

View 9 Replies View Related

How To Customize SSRS 2000 HTML Viewer Without Affecting Other Folders Or Clients?

Apr 17, 2007

Hi all,



Got a good question to ask. At the moment, I do not have any control over the reporting server webserver. This is due to the company's policy. The webhosting is controled by antoher department.



Anyways, the question is the following:- Is there a way to customize the config file for the htmlviewer (css style sheet, rendering and others) for a specific client without affecting the rest ?



There are about 20 clients on a server, and I am responsible for one of them. I had customized my config file to render or allow only two formats for this particular client. Since I don't have any control over the websever, I just can't replace the config file without affecting the others. How do i do this ? I just want th config file to ONLY affect a certain client's HTMLViewer and not the others. I tried to do some research on this, but came up empty handed.



Thanks !



Bernard

View 4 Replies View Related







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