adspace


how we can store the value like that 001,003,023 etc in sql
server 2005

Answer Posted / gopi muluka

Using Character Datatypes
See this
CREATE TABLE NumAsVar (Num VARCHAR(50))
INSERT INTO NumAsVar VALUES ('001')
INSERT INTO NumAsVar VALUES ('002')
INSERT INTO NumAsVar VALUES ('021')

SELECT * FROM NumAsVar

Is This Answer Correct ?    12 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How raid can influence database performance?

1127


What is a scheduled job or what is a scheduled task?

1044


This question asked during interview, 2) At the end of each month, a new table is created for each bank that contains monthly metrics consolidated at the account level. The table naming convention is bankX_YYYYMM where X represents the numeric designation of the bank and YYYYMM indicates the 4 digit year and 2 digit month. The tables contain the following fields: name data type description account text account number registered boolean indicates whether the account is registered num_trans integer number of transactions made during the time period spend numeric(9,2) total spend during the time period a) Write a SQL query that will display the total number of transactions and total spend for "Bank1" during the 4th quarter of 2009. b) Write a SQL query that will display the total number of transactions and total spend at "Bank1" and "Bank2", broken out by registered vs. non-registered accounts, during January 2010 not sure what is correct answer and how to solve?

2576


What is in place upgrade in sql server?

1137


Why should you use or avoid select * statements?

1120


Why use identity in sql server?

1210


What are the different SQL Server Versions you have worked on?

1084


What is clustered index

1094


How can I check that whether automatic statistic update is enabled or not?

1120


When should you use an instead of trigger?

1062


What is self contained sub query?

1148


What are the source of constraints?

1015


How to provide default values to function parameters?

1273


what is spatial nonclustered index

1066


How to rebuild the master database?

1175