SQL Server 2012 :: Can Change Column Width Of Varchar In Production

Oct 17, 2014

I keep getting requests to increase the width of a varchar colum every now and then.

I want to ask if its perfectly ok when you have active users connecting to the application to do this?

View 7 Replies


ADVERTISEMENT

Change Table Column Width

Mar 14, 2000

I know we could change the data type or width of a table column in SQl 7 database, but I am not certain if this column is a primary key. Can we change a primary key column width? If we can, how about this column as a foreign key in another table? Will it be automatically updated to the same width? Thanks in advance for your input.

View 1 Replies View Related

SQL Server 2012 :: How To Get Email Address From Varchar Column

Mar 11, 2014

i have a situation where is need to get email address from a varchar column. Here is some sample data for five records; The format can be change.

dummy text;
Tel: +44 (0)1234 566788;
Email: bbc@co.uk

Admissions dummy text;
T: +44 (0)1234 4444;
E: xyz@co.uk;

dummy text;
dummy text;
Tel: +123 32323 33;
Email: test@yahoo.com;

dummy text;
t: +88 (0) 115 333 5553;
f: +99 (0) 115 222 8888
e: dummy@gmail.com;

dummy text;
t: +11 (0) 222 222 2222;
e: myemail@test.com;
w:http://www.yahoo.com/faqs;

View 4 Replies View Related

SQL Server 2012 :: Table With Column Data - Convert Varchar To Int

Jul 8, 2015

I have a table with column "Data" as VARCHAR, with entries like below.

1
11
2
A1
A10
A11
246
AB1
AB10
100
256
B1
B2
124
20
B21
B31
32
68

I want to select the data by converting varchar to int for numeric values and for alphanumeric it should display as it is.

SELECT CAST(dataAS INT) FROM record_tab

getting below error

Conversion failed when converting the varchar value 'A1'

View 9 Replies View Related

SQL Server 2012 :: Script To Separate Note Column (varchar)

Jul 29, 2015

any tricks to separate this column from:

"testlname,testfname comment section > comment section testlname,testfname 6/30/2015 9:05:58 AM > testlname,testfname 6/30/2015 9:06:18 AM > comment section testlname,testfname 6/30/2015 9:10:05 AM > comment section"

to:

col1 Col2 col3
testlname,testfname 6/30/2015 9:05:58 AM comment section
testlname,testfname 6/30/2015 9:06:18 AM comment section
testlname,testfname 6/30/2015 9:10:05 AM comment section

View 1 Replies View Related

SQL Server 2012 :: Determine Which Column Is Causing Error Converting Data Type Varchar To Numeric?

Aug 14, 2014

I'm moving data from one database to another (INSERT INTO ... SELECT ... FROM ....) and am encountering this error:

Msg 8114, Level 16, State 5, Line 6
Error converting data type varchar to numeric.

My problem is that Line 6 is:

set @brn_pk = '0D4BDE66347C440F'

so that is obviously not the problem and my query has almost 200 columns. I can go through one by one and compare what column is int in my destination table and what is varchar in my source tables, but that could take quite a while. How I can work out what column is causing the problem?

View 3 Replies View Related

Max Width For Input Fixed Width Column

Jun 1, 2007

Is there a maximum width for fixed width column?

I'm trying to read in a flat file (which, admittedly, has one very wide column), and it keeps breaking because of truncation when it tries to read in the file.

Any ideas?

Jim Work

View 5 Replies View Related

OLE DB Source To Flat File Destintation Using Fixed Width Columns - Determining Source Column Width

Feb 13, 2007

Hi,

I am trying to create a program that transfers tables to flat files.
At this point in time, I have suceeded in created one that creates delimited files.

However, I am now trying to create fixed-width files as you can do with the SSIS designer, but programatically.

Is there a way to programatically determine the width of a column from the source table? I can not seem to find any kind of function or member that stores this information or allows me to retrieve it.

I know what I need to change in order to set a width for a column, but I just don't know how to find the width without just asking the user to provide one.

View 5 Replies View Related

Problems Moving Data Over 8000k In DB2 Varchar Column Into SQL Server Varchar(max) Using SSIS

Nov 20, 2007



I have looked far and wide and have not found anything that works to allow me to resolve this issue.

I am moving data from DB2 using the MS OLEDB Provider for DB2. The OLEDB source sees the column of data as DT_TEXT. I setup a destination to SQL Server 2005 and everything looks good until I try and run the package.

I get the error:
[OLE DB Source [277]] Error: An OLE DB error has occurred. Error code: 0x80040E21. An OLE DB record is available. Source: "Microsoft DB2 OLE DB Provider" Hresult: 0x80040E21 Description: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.".

[OLE DB Source [277]] Error: Failed to retrieve long data for column "LIST_DATA_RCVD".

[OLE DB Source [277]] Error: There was an error with output column "LIST_DATA_RCVD" (324) on output "OLE DB Source Output" (287). The column status returned was: "DBSTATUS_UNAVAILABLE".

[OLE DB Source [277]] Error: The "output column "LIST_DATA_RCVD" (324)" failed because error code 0xC0209071 occurred, and the error row disposition on "output column "LIST_DATA_RCVD" (324)" specifies failure on error. An error occurred on the specified object of the specified component.

[DTS.Pipeline] Error: The PrimeOutput method on component "OLE DB Source" (277) returned error code 0xC0209029. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.

Any suggestions on how I can get the large string data in the varchar column in DB2 into the varchar(max) column in SQL Server 2005?

View 10 Replies View Related

SQL 2012 :: Select And Format A Text In A Varchar Column

May 9, 2014

One purchased app stored user's multiple lines input into a varchar column in which including char(13) and char(10).

My app need to select this value and format to multiple lines text in one text box.

How to code to output it?

View 5 Replies View Related

SQL 2012 :: Varchar - Changing Text Column Size

Aug 7, 2015

Impact on performance of changing Text column size.

However, many of them were regarding older releases of SQL Server.

Does the architecture in 2012, 2014 releases make this less of an issue ?

In other words, why bother going from Varchar(1000) to Varchar(50) ?

I'm just thinking maybe there is column compression automatically now.

View 4 Replies View Related

I Need To Make A Minor Change To A SQL Server Script That Is In Production. Need Advice So I Don't Screw Something Up.

Mar 1, 2007

Hello. I am not very strong with SQL server. But I know enough to get my way around. The reason I am asking forhelp is that I need to change a SQL server script that resides on one of the production database servers of thecompany I work for. I just need to add two new lines to the stored procedure.(See the lines that are bolded.) Thesevalues are [MO_FAX],[MO_EMAIL].
Can someone tell me if there is a best way of going about doing this? Can I just simply open up SQL server and quickly make the change? The big issue here is that this script is used in production. So I am just a little worriedabout screwing something up. Anyway, I would appreciate some good advice on this?
 
 
/* Returns all data given the region and country */ALTER  PROCEDURE [dbo].[GetAllInfomration]
AS SELECT   [COUNTRY],  [Company_NAME],   [CompanyAddress],   [CompanyPhone],
  [MO_FAX]  [MO_EMAIL]
  [CompanyFax],
 FROM [InfoLookup].[dbo].[Company_Contact]  RETURN

View 5 Replies View Related

How To Dynamically Change Width?

Feb 7, 2006


Folks,

We have some reports that have optional columns. We have them working very nicely, with the column showing or hiding based on values in the report -- works great.

Except -- when the columns are present, the report spans onto two pages, when exported to PDF, in width. That's understandable, as there's a lot of extra data, and exactly what we want. However, when the columns are not present, we get empty pages instead, because the report doesn't automatically contract back onto the size that fits on one page.

Changing the report to a Matrix won't work, as the hidden columns on some of these come as sets of three, where each column in the three has different formatting (different widths, format codes, etc).

Thanks!
--randy

View 14 Replies View Related

Can I Dynamically Change The Width Of Objects?

Aug 25, 2005

I have a problem using the table object.  I have columns that I sometimes want to show, and I want the page to run off the edge and be two pages.  However, usually I'm hiding many of the columns and the table "shrinks" enough to fit on one page.  When this happens, the table looks right on the first page, but I get blank pages after it, because the report itself will not shrink. 

View 4 Replies View Related

SRS2005 - How Can You Change The Field Width Of The Parameter?

Sep 8, 2007



My value is approx 50 characters wide, the parameter drop down is only displaying about 10 characters, although I have plenty of room on the screen.

Also, in a multi-parameter environment, are there any controls on where the parameters are being displayed?

thanks

View 2 Replies View Related

SQL 2012 :: Full Text Search On Production Server?

Jan 29, 2014

Full Text Searches are working on my test server, but not on my production server. My test scenario is as follows:

CREATE FULLTEXT CATALOG FTC_Test
AS DEFAULT
AUTHORIZATION dbo

CREATE FULLTEXT INDEX ON guest.FtsTest(FullName)
KEY INDEX PK_FtsTest ON FTC_TestI wait briefly and then check to see if the index has been populated:
SELECT * FROM sys.fulltext_indexescrawl_end_date is not null,

So I'm assuming I don't have to wait anymore before I try some FTS searches. Right? I can't get any queries to return anything, though.

The following tells me the full text item count for the table is zero:

DECLARE @TableId INT
SELECT @TableId = id FROM sys.sysobjects WHERE [Name] = 'FtsTest'
SELECT OBJECTPROPERTYEX(@TableId, 'TableFulltextItemCount') AS TableFulltextItemCount

As mentioned, the full text search works on my test server. Both of them are SQL 20012 SP1 (11.0.3000) x64 running on WinServer 2008 R2 SP1.

View 3 Replies View Related

SQL 2012 :: Change Properties Of A Table Which Have Filestream When Column Added To It

Dec 6, 2014

I store files in db in sql server 2008 by filestream. But when a column would be added to table which have filestream, properties of table would be changed. by every things change on table, retrieve files will faced to error. but store process work probably.

and filestream filegroup at following address will be empty. why?

Right click on table --> properties --> storage --> filestream filegroup

View 0 Replies View Related

SQL Server 2012 :: How To Convert Varchar Value To INT

Apr 25, 2014

I am new to T-SQL development and here's what I am trying to do.

declare @cmd varchar(255)
set @cmd = 'select dbid from sys.sysdatabases where dbid not in (1,2,3,4)'

while (@cmd <=13)
begin
insert into #dbcheck values (@cmd)
Set @cmd = @cmd + 1
end

but it is giving me an error

'Msg 245, Level 16, State 1, Line 3
Conversion failed when converting the varchar value 'select dbid from sys.sysdatabases where dbid not in (1,2,3,4)' to data type int.'

Note - #dbcheck has only one column id int

View 3 Replies View Related

How To Change Application To Work With Test DB Opposed To Production DB

May 26, 2015

How do I change application code to easily switch between the application working against a test database versus working with a production database?

My thought is to change the connection string to work with a test DB, and when ready to Publish, change the connection string back to the production DB.  After Publish is successful, change the connection string back to the test DB.

At first, it appears it will work.  Will it?  Whether it will or won't?

View 3 Replies View Related

Column Width

Feb 14, 2005

Hi Every1, I'm getting this error.
'Cannot specify a column width on data type smalldatetime.'
I'm using SQL Server & I've check the data type in the db & it's same as smalldatetime.
Any suggestions would be highly appreciated.
Thanks

<Error>

Column or parameter #8: Cannot specify a column width on data type smalldatetime.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Column or parameter #8: Cannot specify a column width on data type smalldatetime.

Source Error:


Line 344: Try
Line 345: myConnection.Open()
Line 346: dgdSearch.DataSource = myCommand.ExecuteReader()
Line 347: dgdSearch.DataBind()
Line 348: Finally

Source File: c:inetpubwwwrootDemo Equip LogSearch Equipment.aspx.vb Line: 346

Stack Trace:

[SqlException: Column or parameter #8: Cannot specify a column width on data type smalldatetime.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +742
System.Data.SqlClient.SqlCommand.ExecuteReader() +41
Demo_Equip_Log.Search_Equipment.BindGrid() in c:inetpubwwwrootDemo Equip LogSearch Equipment.aspx.vb:346
Demo_Equip_Log.Search_Equipment.Page_Load(Object sender, EventArgs e) in c:inetpubwwwrootDemo Equip LogSearch Equipment.aspx.vb:195
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750

View 2 Replies View Related

SQL Server 2012 :: Storage Of VARCHAR (MAX) When Null

May 7, 2014

If I have a table

CREATE TABLE [dbo].[logg](
[Id] [bigint] IDENTITY(1,1) NOT NULL,
[Details] [varchar](MAX) NULL)

insert logg (Details) values('')
insert logg (Details) values(null)

Will both statements above access only a single page (as it fits into one page) or does the VARCHAR(MAX) always put its data on a separate page. If so, is the null insert treated differently from the '' insert?

View 2 Replies View Related

SQL Server 2012 :: Conversion Failure Varchar To Int

Dec 15, 2014

How do I pass a variable to an INT calculation?

CREATE PROC CLEAR_MY_TABLE
@TableStat varchar(30)
AS
If OBJECT_ID('MyDB.dbo.' + @TableStat + '') is not null
BEGIN
---PRINT 'I FOUND THE TABLE'
DECLARE @count INT = -1;
SELECT @count = (Select COUNT(*) FROM [dbo]. + @TableStat);
IF (@count > 0)
BEGIN
TRUNCATE TABLE @TABLESTAT
END

View 8 Replies View Related

SQL Server 2012 :: Convert Varchar To Time

Mar 9, 2015

I need my code to add the varchar CPUTM field + varchar CPUZIPTIM field which both has time values to see if greater than 2 hours. How do I do this when both fields are varchar. The value in CPUTM field is 335:55:20.97 duration time. My code is below.

CPUTM = 335:55:20.97 duration time
CPUZIPTM = 0:00:01.96 duration time

select * FROM [SMF_DATA].[dbo].[System_Management_Facility]
WHERE ((convert(varchar(13), CONVERT(time, CPUTM) + CONVERT(time, CPUZIPTM))) > '02:00:00.00')

View 2 Replies View Related

SQL Server 2012 :: Converting Varchar To Datetime?

Mar 19, 2015

I am using a custom sql query to import data into Tableau. Problem is I need to change the varchar column data in SQL currently returning 18/01/2014 08:35:13 as a format into the date format 05/21/2014 3:55:51 PM before I can use it.

View 9 Replies View Related

SQL Server 2012 :: SET 1 Symbol Instead Whole String In Varchar Value

Jun 12, 2015

I have such Function:

IF EXISTS (SELECT * FROM sys.objects WHERE name = 'TwoDigitsNumber' AND type = 'FN')
DROP FUNCTION MinimumOFThree;
GO
CREATE FUNCTION TwoDigitsNumber(@a int)
RETURNS nvarchar(20)

[Code] ....

The only first letter 'f', 's', 'e' is inserted in value instead 'first', 'second', 'equal'.

Why ? How can i insert whole string

View 9 Replies View Related

SQL Server 2012 :: Varchar To Datetime Conversion

Aug 14, 2015

I have column moddat which is of varchar(10,null)

Here is my data:
20020415
20020508
19991104
19990701
20040514
20021112
20020124
19990628
20020514
20010822

I want those data in this format YYYY-MM-DD

How to convert varchar to datetime?

View 2 Replies View Related

Integration Services :: How To Change Variable Name In Production Database Level

Jul 23, 2015

I have package there i have multiple tasks,I have used one User definied varible into my package level,So here my condition is i want to change my variable name from the package level,Here that variable used in different places in my package level,it has used in some places as well in my package level.

I need to change my Variable name after development of my package so how it will changed.

View 4 Replies View Related

0 Width Of Column Error

Feb 9, 2001

Hi

When i create a temp table with a field as blank string as in following example and then try to insert a blank string int it following error is coing.
compatibility level of database is 70

following is the example

Select CtpId = convert(int, a.CtpId), a.OrgId, a.Sname, a.Intls, a.Prfx, a.CallName, a.Sex, a.RspblEmp,
City = convert(char(40), ''), OrgDescr = convert(char(46), ''),
a.ActvtyStatus, a.Sales, a.SaleCntct, a.ContractCntct, a.ContractSigner,
a.CRW, a.WkndCntct, a.UseOrgAddr, CtpTimeStamp = convert(int, a.TimeStamp), FrequentFlyer = convert(bit,0) ,
a.PrevCmpl, b.St, a.DtIns
into #Ctp
from tbCtp a, tbAddr b
where 0 = 1




Select a.CtpId, a.OrgId, a.Sname, a.Intls, a.Prfx, a.CallName, a.Sex, a.RspblEmp,
City = '', OrgDescr = '',
a.ActvtyStatus, a.Sales, a.SaleCntct, a.ContractCntct, a.ContractSigner,
a.CRW, a.WkndCntct, a.UseOrgAddr, CtpTimeStamp = convert(int, a.TimeStamp),FrequentFlyer = 0, a.PrevCmpl,
St = "", a.DtIns
into #CTP
from tbctp a
where a.Sname like 'as%'
and CallName = '%'



ERROR MESSAGE:: Server: Msg 2731, Level 16, State 1, Line 1
"The width of column 'City' is 0. This width is not valid."

Please tell why this error is coming.

Thanks in advance

Rajesh

View 2 Replies View Related

Bar Chart Column Width

May 15, 2008

Is there a way to change the width of the bars in a bar chart?

I know that there is an option to 'Plot the data as line', but for some reason this is greyed out.

Any ideas on both?

View 6 Replies View Related

Column Width Workarounds

Jul 3, 2007

I have been looking over the forums looking for answers to the question that nails us all: how do you dynamically resize column widths? MS says: you don't. However, I have heard many people say they have found ways around it. I wonder if anyone might share those with me (and everyone else). Share the wisdom you have gained with those less experienced!

View 1 Replies View Related

SQL Server 2012 :: Conversion Failed When Converting Varchar Value

Dec 19, 2013

Within in Visual Studio 2012 solution, I have several projects, one of which is a Database project. I am defining several tables. The one in question is:

CREATE TABLE [dbo].[tblKppHierarchyPcl]
(
[ID] NUMERIC(18,0) NOT NULL,
[Name] VARCHAR(500),
[PartStructureKey] NUMERIC(18,0) NOT NULL,
[PartNumber] VARCHAR(500) NOT NULL,
[ParentPartNumber] VARCHAR(500) NULL,

[code]...

Error SQL72014: .Net SqlClient Data Provider: Msg 245, Level 16, State 1, Line 76 Conversion.failed when converting the varchar value 'Coolant Quick Disconnect' to data type int.So it has a problem with inserting 'Coolant Quick Disconnect' into the Name column. The Name column is CLEARLY a varchar column but somehow it thinks it's an int column.

View 8 Replies View Related

SQL Server 2012 :: How To Preserve Tags In Varchar Output

May 6, 2015

I have following XQuery:

declare @xmldoc as xml
select @xmldoc = '<Text>This is firstline<Break />This is second line<Break />This is third line</Text>'
select @xmldoc.value('(/Text)[1]','varchar(max)')Result is: "This is firstlineThis is second lineThis is third line"

My problem is, that the <Break /> tags within the text are removed in the conversion to varchar. How to preserve the such tags in the varchar output? Or to get the <Break /> tags "translated" to e.g. CHAR(10)?

View 2 Replies View Related

Select Columns With Correct Width For Fixed Width Flat File?

Dec 6, 2013

I have like 100 columns and most of them work fine, but some will not work. I need to select the columns with correct width for fixed width flat file.

Here is typical SQL statment that works for most of them.

left(RTRIM(A.City) + Replicate(' ', 25) ,25) as [City]

The above one is not working, but many other works fine like the address. Why would it work for some, but not others?

It works fine if I use any char, but not space. i.e.

left(RTRIM(A.City) + Replicate('*', 25) ,25) as [City]

View 5 Replies View Related







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