Enter Data In A Mask Format

Aug 20, 2006

sorry for my question, maybe it seems un professional but I need to know the answer,

is it possible to enter the data in a sql table in a specific format and how it could be?

for example I want to have a mask in the table to enter the data in this format ##.## so it will not accept any other data to be typed in without this format.



Regards

View 4 Replies


ADVERTISEMENT

Forcing Data Format Mask Without Modifting Code

Sep 24, 2004

I have statement which is comparing a smalldatetime column to literal string as follows:

sales_date ='21-9-2004 0:0:0.000'

when I run the statement in query analyzer it bombs out with:

Server: Msg 296, Level 16, State 3, Line 1
The conversion of char data type to smalldatetime data type resulted in an out-of-range smalldatetime value.

If I alter the format of the date literal to '2004-09-21 00:00:00' the statement works.

Is there anyway of forcing the statement to treat '21-9-2004 0:0:0.000' as '2004-09-21 00:00:00' without modifying the statement itself ?

View 4 Replies View Related

The Affinity Mask Specified Does Not Match The CPU Mask On This System.

Nov 17, 2007

We are having a problem with one of our SQL servers, and in comparing it to the backup server which is working fine, I noticed some differences. I attempted to correct the differences, but no luck.
The dell server has 4 dual-core processors and at one point hyper-threading was enabled. One of our DBAs recommended that it be turned off. We didn't have any major problems until recently and it seems that getting this setting right is the lynchpin. Any suggestions?

John




EXEC sys.sp_configure N'show advanced options', N'1' RECONFIGURE WITH OVERRIDE

GO

EXEC sys.sp_configure N'affinity mask', N'0'

GO

EXEC sys.sp_configure N'affinity I/O mask', N'0'

GO

RECONFIGURE WITH OVERRIDE

GO

EXEC sys.sp_configure N'show advanced options', N'0' RECONFIGURE WITH OVERRIDE

GO

-----------------------------------------


Configuration option 'show advanced options' changed from 0 to 1. Run the RECONFIGURE statement to install.

Msg 5832, Level 16, State 1, Line 1

The affinity mask specified does not match the CPU mask on this system.

Msg 15123, Level 16, State 1, Procedure sp_configure, Line 51

The configuration option 'affinity mask' does not exist, or it may be an advanced option.

Msg 15123, Level 16, State 1, Procedure sp_configure, Line 51

The configuration option 'affinity I/O mask' does not exist, or it may be an advanced option.

Msg 5832, Level 16, State 1, Line 1

The affinity mask specified does not match the CPU mask on this system.

Configuration option 'show advanced options' changed from 1 to 0. Run the RECONFIGURE statement to install.

Msg 5832, Level 16, State 1, Line 1

The affinity mask specified does not match the CPU mask on this system.

View 7 Replies View Related

SELECT - BETWEEN &<mask&> AND &<mask&>

May 10, 2004

I have a table into which users can enter a To and From range, and an application returns all the values in between. Naturally the users can enter to and from values that don't exist, as all they need to do is satisfy a "between" expression. eg they can enter '1100' to '1399' and even though neither value actually exists in the data, the query will return all the values that fall into the desired range.

However the application now demands a bit more of a sophisticated approach. The target data may have the form 'nn-nnnn-nn' where n is '0' to '9', and the user wants to select all the values (in pseudo-code) which satisfy a pattern like '%-7040-%' and '%-7400-%'

A simple LIKE expression with a mask containing a RegEx won't work - ie LIKE '%-7[0-4][0-4]0-%' doesn't work because (eg) '00-7150-00' won't satisfy the mask because of the 5 falling outside [0-4], although it is within the range I want.

I have come up with a solution to this problem by using MIN and MAX aggregate functions on LIKE [From] and LIKE [To] respectively and this works fine. eg

"SELECT A.<something> from <target_table1> A, <table_with_ranges> B WHERE A.<something> BETWEEN (SELECT MIN(X.<something>) FROM <target_table1> X WHERE X.<something> LIKE B.[From]) AND (SELECT MAX(X.<something>) FROM <target_table1> X WHERE X.<something> LIKE B.[To])"

It's actually quite a bit more complicated than that - I have simplified the SQL a bit, but that is the basic algorithm.

The problem is that for the BETWEEN expression to work, both the MAX and MIN functions have to return a value that is not NULL- ie there has to be a value in the target table which satisfies the mask. In the application, this is not always going to be the case - Users will want to create large ranges to allow for future growth so every time they enter new data into target_table1 the don't then have to go out and redfine the [From] and [To] ranges to satisfy the new data. What I really need is an SQL expression along the lines of "SELECT .... FROM ... WHERE A BETWEEN <pattern1> AND <pattern2>" where <pattern1> and <pattern2> contain wildcards.

Anyone got any suggestions??? By the way, using SUBSTRING or other string functions is NOT an option for a variety of reasons.

View 3 Replies View Related

How To Mask Password Text In SQL Field Data Type.

Mar 12, 2007

AnupG writes "hi,
the most common feature that any RDBMS provides should be that if we want to store the data in the MSSQL tables then the data should be presented in masked/formatted like for eg.the password text in field should be like "*****". I am using SQL 2000 but i unofrtunately i couldn't find any such feature in defining the data type in SQL server 2000 ...?"

View 2 Replies View Related

What Happens If Affinity Mask And Affinity I/O Mask Are Not Mutually Exclusive?

Jan 21, 2008



I have a dual 64 bit quad core server with 16 GB of memory. We are going to run an application server and SQL Server 2005 SP2 CU4 64 bit on this hardware, but we only want to purchase a single CPU license for SQL Server. The obvious choice is to use the affinity settings to prevent SQL Server from using one of the CPUs.

Initially, the development team simply went into SSMS and unchecked affinity mask and affinity io mask for the first four processors. This appeared to work fine in their testing. A problem arose when we started monitoring the maintenance plan and saw that the database integrity check was failing. The root problem was this invalid state that the affinity masks were in.

I have seen a lot of documentation stating the SQL Server will ignore an invalid mask setting, but in our testing, it appears that SQL Server respects the setting. For example, when we set CPU 7 to be available for processing and IO, Performance Monitor showed that only CPU 7 was used during a load test.

So from our preliminary testing, it looks like SQL Server will use a single CPU for both processing and IO if you tell it to. Is there some other reason why these affinity settings need to be mutually exclusive? Is there a test I can run that can illustrate why?

View 7 Replies View Related

Can't Enter Data In Field

May 30, 2007

I have a field in my table that is varchar:1500:null, but I cannot enter any more that 994 characters. any ideas why?

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Quotes]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Quotes]
GO

CREATE TABLE [dbo].[Quotes] (
[QuoteID] [int] IDENTITY (1, 1) NOT NULL ,
[DateAdded] [datetime] NULL ,
[CustomerID] [int] NOT NULL ,
[ProductName] [varchar] (100) NULL ,
[RepID] [int] NULL ,
[QuoteNumber] [varchar] (30) NULL ,
[QuoteDate] [datetime] NULL ,
[QuoteTerm] [varchar] (10) NULL ,
[QuoteFOB] [varchar] (15) NULL ,
[QuoteNAIRep] [varchar] (30) NULL ,
[QuoteExpiration] [datetime] NULL ,
[Note] [varchar] (700) NULL ,
[Comment] [varchar] (1500) NULL ,
[OrderRequirement] [varchar] (1000) NULL ,
[Status] [varchar] (1) NULL ,
[DateClosed] [datetime] NULL ,
[ProductType] [varchar] (30) NULL ,
[ImageID] [int] NULL ,
[CloseMonth] [int] NULL ,
[CloseYear] [int] NULL ,
[ClosePercent] [int] NULL ,
[Segment] [varchar] (50) NULL ,
[AccountID] [uniqueidentifier] NULL ,
[ReplacedQuoteID] [int] NULL ,
[Lead] [varchar] (80) NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Quotes] ADD
CONSTRAINT [DF_Quotes_Closed] DEFAULT ('N') FOR [Status]
GO

CREATE INDEX [idx_RepID] ON [dbo].[Quotes]([RepID]) ON [PRIMARY]
GO

CREATE INDEX [indx_CustomerID] ON [dbo].[Quotes]([CustomerID]) ON [PRIMARY]
GO

CREATE INDEX [indx_QuoteID] ON [dbo].[Quotes]([QuoteID]) ON [PRIMARY]
GO

CREATE INDEX [indx_Status] ON [dbo].[Quotes]([Status]) ON [PRIMARY]
GO



[Comment] [varchar] (1500) NULL , is where I can't enter more than 994 characters.

note - I know very little about SQL, I just had the responsibility placed on me at my job. If this is not enough information to go on to throw an idea at me please let me know what else you need.

Thanks in advance

View 5 Replies View Related

Forms To Enter Data Into SSMS?

Oct 1, 2015

giving a use access to enter data into one database table.

I know Access is an option, but I was wondering if there was another, like MS Word or Adobe.

This is a SSMS database, 2008.

View 3 Replies View Related

For / While Loop - Enter Data Into A Table

Feb 19, 2015

I want to, for each month of the year 2014 say, to create a loop that will enter data into a table.

Right now I have:

Select [Member Number],
sum(case when [Receipt Date]='2014/01/01' then Amount else 0 end) as [Rec 2014/01/01]
From [Receipts Table]
Group by [Member Number]
Insert into [Receipts 2014/01/01]

[Code] ....

Instead I would just like to do something like…

Declare i date
For i=2014/01/01 to 2014/12/01

Select [Member Number],
sum(case when [Receipt Date]=i then Amount else 0 end) as [Rec +i]

From [Receipts Table]
Group by [Member Number]
Insert into [Receipts + i]

Don’t know if this is at all possible?

View 2 Replies View Related

Affinity Mask And Affinity I/O Mask Configuration

Sep 17, 2007

I'm experiencing some problem with the affinity mask and affinity I/O mask configuration.

We are running SQL Server Enterprise Edition 2005 64bit on Windows 2003 Server 64bit with 4 dual core CPU. The actuelly configuration is:

Affinity Mask Affinity I/O Mask
CPU0 0 0
CPU1 0 0
CPU2 1 1
CPU3 1 1
CPU4 1 1
CPU5 1 1
CPU6 1 1
CPU7 1 1


We did it so, because we are running LiteSpeed Tool for the backup. LiteSpeed is configured to use CPU0 and CPU1.

Now, we know that the settings are wrong. If Affinity mask is 1 affinity I/O mask should be 0 and vice-versa.

My question is: how many CPU should I enable for affinity mask and how many for affinity I/O mask. Which are the correct criterias.

Thx in advence.
Laurent

View 2 Replies View Related

Recommended Data Type For Price (Can Enter TBA && Money)

Jun 9, 2007

 what is the recommended data type i should use if i want to have a price field that can include "TBA". i can't use smallmoney i suppose, so i should use VARCHAR then validate the String with Visual Studio?

View 1 Replies View Related

Basic Webpage To Enter Data Into Multiple Tables?

Apr 27, 2015

Make a few simple pages to enter data into multiple tables in my SQL DB.

I have the DB designed and IIS setup but I am trying to wrap my head around the php connection to the DB and then relating the tables/columns in the "Input" page.

After this is done I will use SRS to use these entries to show reports hourly.

View 4 Replies View Related

I Want Ot Convert Xml Data Format Into The General Data Format

Jun 9, 2006

hi siri have table hh .it has two columnsone is hhno is integer datatype another hhdoc is xml data type likehh tablehhno hhdoc---------------------------------------------------------------------------------------------100<suresh>sfjfjfjfjf</suresh>....................................101<ramesh>hhfhfhf</ramesh>..................................how to convert the xml data format into the general data format plshelp me with examples

View 1 Replies View Related

How Do I Enter NULL In A Table Cell In The Enterprise Manager UI For Table Data Entry?

Sep 9, 2005

I have a column defined as smalldatetime. Default length (4), and "allow NULLS" is checked.In the Enterprise Manager UI, when i enter data into that table row, if i just tab past that column, all is well, and the value is represented in the UI as <NULL>.The problem comes once i ever enter a date into that column.  Say i have entered a date (all is well), and now i want to remove that entry and go back to NULL (after the date value has been committed, different entry session, say).How is that done?It seems to me, once a date has ever been entered into that column, now, if i try to remove it, i get the error "The value you entered is not consistant with the data type or length of the column, or over grid buffer limit".  I have tried deleting the value, entering spaces, entering the string NULL or the string <NULL>; maybe some other tries as well, but none works, i always get that error message and am not allowed to proceed past that cell until i restore a date value to it.  I want to get back to <NULL>.Anybody know?Thank you.Tom

View 1 Replies View Related

Between [Enter The Start Date] And [Enter The End Date])

Mar 28, 2007

Hi all can you help me please, I need the users to be able to enter in a date for a self generating report. Usually I use the @Enter_Date but I need them to be able to enter a start date and a end date
But when I run this query SQL gives me an error message Server: Msg 207, Level 16, State 3, Line 1
Invalid column name 'Enter the Start Date'.
Server: Msg 207, Level 16, State 1, Line 1
Invalid column name 'Enter the End Date'.

What should use in place of BETWEEN [Enter the Start Date] And [Enter the End Date]??


SELECT [Main Table].[IR Number], [Main Table].Date, [Main Table].Inspector, [Main Table].Area, [Main Table].Violation, [Main Table].[Violation Type], [Main Table].Loss, [Main Table].[Loss Type], [Main Table].Employee, [Main Table].Action, [Main Table].[Action Type], [Main Table].Notes
FROM [Main Table]
WHERE ((([Main Table].Date) Between [Enter the Start Date] And [Enter the End Date]))
ORDER BY [Main Table].[IR Number]

View 4 Replies View Related

How Can I Mask A Column In A Sql Server Database

Sep 26, 2007

Hi i have a table in my database and i want to mask or encrypt a particular column in it? How can i do it.
 
Any help will be appreciated.
Regards
Karen

View 1 Replies View Related

SQL 2012 :: Config Value For Affinity Mask

Aug 7, 2014

I ran ALTER SERVER CONFIGURATION SET PROCESS AFFINITY CPU = 2,3 that means the SQL server 2012 is using the 2nd and 3rd CPU's respectively..

Now, when I run sp_configure 'affinity mask' I get the config_value as 12, so how it is getting calculated?

is there a code for each CPU?? wanted to know about this.

View 4 Replies View Related

IP Address And Subnet Mask Calculations

Nov 12, 2007

-- Prepare sample data
DECLARE@Sample TABLE (ID INT, NetworkIP VARCHAR(15), SubnetMask VARCHAR(15))

INSERT@Sample
SELECT1, '192.168.1.0', '255.255.255.128' UNION ALL
SELECT2, '10.1.1.64', '255.255.255.240' UNION ALL
SELECT3, '172.16.11.0', '255.255.255.252'

-- Show the expected output
SELECTID,
NetworkIP,
SubnetMask,
dbo.fnIsInRangeIP('192.168.1.5', NetworkIP, SubnetMask) AS IsInRange
FROM@SampleAnd here is the function codeCREATE FUNCTION dbo.fnIsInRangeIP
(
@IP VARCHAR(15),
@NetIP VARCHAR(15),
@MaskIP VARCHAR(15)
)
RETURNS BIT
AS
BEGIN
RETURNCASE
WHENCAST(PARSENAME(@IP, 4) AS TINYINT) & CAST(PARSENAME(@MaskIP, 4) AS TINYINT) = CAST(PARSENAME(@NetIP, 4) AS TINYINT) & CAST(PARSENAME(@MaskIP, 4) AS TINYINT)
AND CAST(PARSENAME(@IP, 3) AS TINYINT) & CAST(PARSENAME(@MaskIP, 3) AS TINYINT) = CAST(PARSENAME(@NetIP, 3) AS TINYINT) & CAST(PARSENAME(@MaskIP, 3) AS TINYINT)
AND CAST(PARSENAME(@IP, 2) AS TINYINT) & CAST(PARSENAME(@MaskIP, 2) AS TINYINT) = CAST(PARSENAME(@NetIP, 2) AS TINYINT) & CAST(PARSENAME(@MaskIP, 2) AS TINYINT)
AND CAST(PARSENAME(@IP, 1) AS TINYINT) & CAST(PARSENAME(@MaskIP, 1) AS TINYINT) = CAST(PARSENAME(@NetIP, 1) AS TINYINT) & CAST(PARSENAME(@MaskIP, 1) AS TINYINT)
THEN1
ELSE0
END
ENDE 12°55'05.25"
N 56°04'39.16"

View 1 Replies View Related

ForEach File - Filename Mask

Dec 20, 2007



Hello

I'm using the ForEach File task and masking the files I want to process as ABC??.TXT.
It all works well until I drop a file there like ABC12 Copy.TXT, which I don't expect to be process, but the loop still picks it up. Am I using the wrong wildcards?

newstar1860

View 18 Replies View Related

How Can I Encrypt Or Mask A Column In The Database

Sep 26, 2007



How can i encrypt or mask a column in the database?

Any help will be appreciated
Regards
Karen

View 4 Replies View Related

Stripping Input Mask From Phone Numbers

Mar 28, 2006

Hello, I have this Access 2K query that I need to re-create in MS SQLServer 2000, so I'm using the Query Analyzer to test it.One of the Access fields stores the home phone number. In the Accessquery, if the phone number is null, it fills it up with zeroes"000000000." If the phone has an input mask, it only gets the 9 numbers(area code included) and if the phone number's good (all numbers) thenit leaves it alone. That Access query is using immediate ifs toaccomplish that task.Does anyone have any idea how to copy this behavior into SQL Server2000? I've using the CASE statement but so far my code is not correct.I get stuck in the input mask. This is the Access code:HomePhone:IIf(IsNull([HomePhone]),"0000000000",IIf(Left([HomePhone],1)="(",Right(Left([Homephone],4),3)& Right(Left([Homephone],9),3) & Right([HomePhone],4),[HomePhone]))Thanks for all your help.JR.

View 2 Replies View Related

Syntax Problem With Mask Special Characters

Sep 29, 2006

I have the following t-sql syntax

problem is masking information after like as special characters.

I will search for all entries in column filedirectory which begins with \

DECLARE @cmd varchar(255)
SET @cmd = 'SELECT id,name,filedirectory FROM MR_ReqPro.RQDOCUMENTS WHERE FILEDIRECTORY LIKE  ' \%'  '
print @cmd

EXEC master.dbo.xp_sendmail @recipients = 'kalleOO7@web.de',
   @query = @cmd , @subject = 'Fehler', @message = 'Fehler :', @attach_results = 'TRUE', @width = 2000

Thx

Kalle

 

here is the solution

DECLARE @cmd varchar(255)
SET @cmd = 'SELECT id, name, filedirectory FROM MR_ReqPro.RQDOCUMENTS WHERE filedirectory LIKE ''\%'' '
print @cmd

seems to work :-)

View 1 Replies View Related

How To Get The SQL Affinity Mask Value In Sql 2005, And Table That Store This Info

Aug 29, 2006



Hi All

Can u pls tell me How to Get the SQL Affinity Mask value in Sql 2005.

and what is the table/views name that store this info.

for SQL 2000 , we were using following query:

SQLStatement.printf("select c.value from master..sysconfigures c, master..spt_values v,"
"master..syscurconfigs r where v.type = 'C' and v.number = c.config and v.number >= 0 "
"and v.number = r.config and v.name ='affinity mask'");

lErrCode=SQLExecDirect(hStmt,(SQLCHAR*)pszSQLStatement,strlen(pszSQLStatement));

lSQLBindCol(nAffMask);

But With SQL 2005 , we are getting ZERO(0) ROWS SELECTED.

View 1 Replies View Related

&#39;enter&#39; Character.

Aug 8, 2002

How do I replcae an 'enter' character with a space in a field? This extra spaces entered in the web form while populating the field is causing extra spaces in the field. What is the ASCII value for the 'enter' character? so that we can replace that with a space?
Thanks.
sa.

View 2 Replies View Related

Enter Parameter Value

Mar 29, 2006

Hey in Access MDB you can create a query that when you run it, it will ask you to Enter the Paramer Value, User could enter in a year or Team Member Number or however you have the query set up. is this possible in SQL ADP???

View 10 Replies View Related

You Must Enter A Subject

Oct 8, 2004

Question: Why is Graz a moderator on this forum? And on nothing else?



Brett

8-)

View 4 Replies View Related

Data Format Issue While Importing Data From Excel To SQL

Jul 17, 2007

hi



when i m importing data from excel to Sql using DTS the column which has text content was not imported as same in excel sheet. whereas a special character is appearing in between the lines. the text field contains multiple lines but the conetent is imported in single line .

ex:









ARIZONA
ALABAMA
STATE


but i m getting imported

as :
ARIZONA ALABAMA STATE

How to Format a single column while importing?



Regards

Raj

View 1 Replies View Related

Enter Record (Sancronized)

Jan 28, 2008

Hi,

I have two tables. Class & Faculty

"Class" table have column names ClassID, SchoolID and FacultyID(FacultyID column have just created therefore there is no data in the column)
"Faculty" table have column names FacultyID, SchoolID

In "class" table every SchoolID have 1 or 2 classID. Whereas in "Faculty" table every facultyID have more than 3 SchoolID.

Therefore when I update the table it only update the rows not entering new rows as per schoolID.

How can we add new rows in the class table according SchoolID,
Because I want to get data in the newly generated column FacultyID in "CLASS" table.

Thanks,



Navi

View 5 Replies View Related

Trying To Enter More Than One Selected Value Into One Column In The Database.

Feb 1, 2008

Hi i am trying to enter more than one value into my constructor field in my database, at the moment when the values are entered into the database through the front end, they appear in the database as seperate records however they have the same ID,  the only thing that changes is are the data in the fields which i want in just one. This is the part of the stored procedure I am sure is causing this to happen;
IF @Access_Right_ID=8  or @Access_Right_ID=3  or @Access_Right_ID=9   BEGIN     DECLARE @Delimiter char(1)     SET @Delimiter = ','     DECLARE @CommaPos int     SET @CommaPos = Charindex(@Delimiter,@Constructor_IDs)       DECLARE @Remaining_Constructor_IDs VARCHAR(8000)     SET @Remaining_Constructor_IDs = @Constructor_IDs            DECLARE @Constructor_ID int                     WHILE (@CommaPos>=0)     BEGIN     
     SET @CommaPos = Charindex(@Delimiter,@Remaining_Constructor_IDs)             if   @CommaPos >0            SET @Constructor_ID = ltrim(rtrim(Substring(@Remaining_Constructor_IDs,1,@CommaPos-1)))           else            SET @Constructor_ID = @Remaining_Constructor_IDs                        INSERT INTO tblUser_Constructor      ( User_ID,  Constructor_ID)     VALUES     (@User_ID, @Constructor_ID )         SET @Remaining_Constructor_IDs = SUBSTRING(@Remaining_Constructor_IDs,@CommaPos+1,LEN(@Remaining_Constructor_IDs)-@CommaPos)           if @CommaPos=0      set @CommaPos = -1          END

View 2 Replies View Related

How To Enter A Date Parameter In Debugger

Jun 22, 2004

(This is prob. a really dumb question but it's driving me mad!!...)

I am using the Debugger in SQL Query Analyzer & want to set the value of a datetime parameter prior to executing the stored proc. The "Debug procedure" window allows me to specify the parameter values - but I can't get it to accept a datetime. The language is us_english & I've tried most ways if specifying the date - 01/02/2004, with/out quotes, 02 Jan 2004, as a full datetime, swapping day/month values etc etc. The procedure always fails immediately with: Invalid character value for cast specification.

Thanks.

View 1 Replies View Related

Possible For User To Enter A Range Of Date

Nov 24, 2014

I have been asked to write a query on SBO.It requires (among other) a reference to a budget, which does not exist anywhere now.It is a yearly budget that changes quarterly.I suppose I could add a table and update the no. each quarter - but will the history be kept?What would you recommend?Also, they require a quarterly comparison (all in the same report) is it possible for the user to enter a range of date (for sales data, for example) and also receive the data for that range only last year's?

View 5 Replies View Related

How To Enter Single Quote Character

Sep 22, 2006

Hi all

How to enter single quote character in a sting column for eg: Channel's

Thanks

View 6 Replies View Related

Enter Windows Authentication On Connect?

Nov 30, 2007

I'm trying to connect to a database using my virtual machine, where I´m logged in as another user than the one that's granted acccess to the database. Can I enter the windows username and password used to connect to my SQL 2005 database, in Windows Authentication Mode?

Jakob

View 4 Replies View Related







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