Jump to content

Ms Sql Server Technology Discussions


9Pardhu

Recommended Posts

Naku okA doubt. 2005 lo ssis package rasina..... oka view nundi danini Flat file lo ki store chestuna. AA view total rows 450K ala vundi. 8:30 ki start chesa epudu 10:13 iyindi inka 184K rows ee copy iyayi.


Package ela chesanu.........>> OlEDB source--------- Data Conversion--------- Flat file destination...

emaina thapu chestunana ani na doubt.

Link to comment
Share on other sites

[quote name='Desamudhuru' timestamp='1353082533' post='1302807101']
Naku okA doubt. 2005 lo ssis package rasina..... oka view nundi danini Flat file lo ki store chestuna. AA view total rows 450K ala vundi. 8:30 ki start chesa epudu 10:13 iyindi inka 184K rows ee copy iyayi.


Package ela chesanu.........>> OlEDB source--------- Data Conversion--------- Flat file destination...

emaina thapu chestunana ani na doubt.
[/quote]

madhyalo data conversion enduku malli?

Link to comment
Share on other sites

[b] [url="http://blog.sqlauthority.com/2012/11/18/sqlauthority-news-microsoft-sql-server-2012-service-pack-1-released-sp1/"]Microsoft SQL Server 2012 Service Pack 1 Released (SP1)[/url][/b]


This service pack contains SQL Server 2012 Cumulative Update 1 (CU1) and Cumulative Update 2 (CU2).
The latest SP1 has many new and enhanced features. Here are a few for example:[list]
[*]Cross-Cluster Migration of AlwaysOn Availability Groups for OS Upgrade
[*]Selective XML Index
[*]DBCC SHOW_STATISTICS works with SELECT permission
[*]New function returns statistics properties – sys.dm_db_stats_properties
[*]SSMS Complete in Express
[*]SlipStream Full Installation
[*]Business Intelligence highlights with Office and SharePoint Server 2013
[*]Management Object Support Added for Resource Governor DDL
[/list]
Please note that the size of the service pack is near 1 GB.
Here is the link to [b][url="http://www.microsoft.com/en-us/download/details.aspx?id=35575"]SQL Server 2012 Service Pack 1[/url][/b].
SQL Server Express is the free and feature rich edition of the SQL Server. It is used with lightweight website and desktop applications.
Here is the link to [b][url="http://www.microsoft.com/en-us/download/details.aspx?id=35579"]SQL Server 2012 EXPRESS Service Pack 1[/url][/b].

Link to comment
Share on other sites

[b] Removing Leading Zeros From Column in Table[/b]


[color=blue]USE [/color][color=black]tempdb
GO[/color]
[color=green]-- Create sample table[/color]
[color=blue]CREATE TABLE [/color][color=black]Table1 [/color][color=gray]([/color][color=black]Col1 [/color][color=blue]VARCHAR[/color][color=gray]([/color][color=black]100[/color][color=gray]))[/color]
[color=blue]INSERT INTO [/color][color=black]Table1 [/color][color=gray]([/color][color=black]Col1[/color][color=gray])[/color]
[color=blue]SELECT [/color][color=red]'0001'[/color]
[color=blue]UNION [/color][color=gray]ALL[/color]
[color=blue]SELECT [/color][color=red]'000100'[/color]
[color=blue]UNION [/color][color=gray]ALL[/color]
[color=blue]SELECT [/color][color=red]'100100'[/color]
[color=blue]UNION [/color][color=gray]ALL[/color]
[color=blue]SELECT [/color][color=red]'000 0001'[/color]
[color=blue]UNION [/color][color=gray]ALL[/color]
[color=blue]SELECT [/color][color=red]'00.001'[/color]
[color=blue]UNION [/color][color=gray]ALL[/color]
[color=blue]SELECT [/color][color=red]'01.001'[/color]
[color=black]GO[/color]
[color=green]-- Original data[/color]
[color=blue]SELECT [/color][color=gray]*[/color]
[color=blue]FROM [/color][color=black]Table1
GO[/color]
[color=green]-- Remove leading zeros[/color]
[color=blue]SELECT[/color]
[color=magenta]SUBSTRING[/color][color=gray]([/color][color=black]Col1[/color][color=gray], [/color][color=magenta]PATINDEX[/color][color=gray]([/color][color=red]'%[^0 ]%'[/color][color=gray], [/color][color=black]Col1 [/color][color=gray]+ [/color][color=red]' '[/color][color=gray]), [/color][color=magenta]LEN[/color][color=gray]([/color][color=black]Col1[/color][color=gray]))[/color]
[color=blue]FROM [/color][color=black]Table1
GO[/color]
[color=green]-- Clean up[/color]
[color=blue]DROP TABLE [/color][color=black]Table1
GO[/color]
Here is the resultset of above script. It will remove any leading zero or space and will display the number accordingly.
[img]http://www.pinaldave.com/bimg/leadingzeroes.jpg[/img]


[u][b]Alternate Solutions:[/b][/u]

SELECT
SUBSTRING(Col1, PATINDEX('%[^0 ]%', Col1 + 'a'), LEN(Col1))
FROM Table1



SELECT
RIGHT(Col1, LEN(Col1)+1 -PATINDEX('%[^0 ]%', Col1 + 'a' ))
FROM Table1

Link to comment
Share on other sites

What is returned from #tblTrans when you run the below code.

CREATE TABLE #tblTrans(RowId TINYINT)
GO
BEGIN TRAN
DECLARE @getId TINYINT
SET @getId=100
INSERT INTO #tblTrans (RowId) VALUES(@getId)
IF @getId >10
RAISERROR('RowId should not be greater than 10',11,16)
PRINT @@ERROR
IF @@ERROR = 0
BEGIN
COMMIT TRAN
PRINT 'I am here at commit!'
END
ELSE
BEGIN
ROLLBACK TRAN
PRINT 'I am here at rollback!'
END
GO
SELECT * FROM #tblTrans

[b]Answer: [/b]100
[b]Explanation: [/b]@@ERROR Returns the error number for the last Transact-SQL statement executed. In this example, though error is generated using RAISERROR the next immediate statement is PRINT @ERROR which resets the error number to "0". It is best practice to remove the PRINT statement when you move your code to production environment.

Ref: Using @@Error - [url="http://www.sqlservercentral.com/links/1427054/281359"]http://msdn.microsoft.com/en-us/library/ms190193%28v=SQL.105%29.aspx[/url]

Link to comment
Share on other sites

declare @x float, @y float

set @x = 3.65
set @y = 3.75

--What values are returned by the following statements?
select 'x = ' + str(@x,10,1)
select 'y = ' + str(@y,10,1)


nee yavva okkadu kuda follow avvatam leda? answers cheppandi vayya deeniki with reason

Link to comment
Share on other sites

[quote name='deals2buy' timestamp='1353335797' post='1302822500']
declare @x float, @y float

set @x = 3.65
set @y = 3.75

--What values are returned by the following statements?
select 'x = ' + str(@x,10,1)
select 'y = ' + str(@y,10,1)


nee yavva okkadu kuda follow avvatam leda? answers cheppandi vayya deeniki with reason
[/quote]

STR function returns char data from numeric data.

the ansers are x=3.7
y=3.8

Link to comment
Share on other sites

[quote name='gundugadu' timestamp='1353338316' post='1302822644']
STR function returns char data from numeric data.

the ansers are x=3.7
y=3.8
[/quote]
thankyou for the reply

kaani naaku x=3.6, y=3.8 vastunnay mama

anduke doubt vachindi

Link to comment
Share on other sites

ravadam ledu baaaa
x ki 3.6 ye vasthundi
and y di roof function chesthundi


donno why x is the same 3.6

nuvvemina catch chesthava leda ani ala x value thappu pettina
sSc_hidingsofa sSc_hidingsofa

u rock reeeeeeeeeee

Link to comment
Share on other sites

[quote name='gundugadu' timestamp='1353338968' post='1302822689']
ravadam ledu baaaa
x ki 3.6 ye vasthundi
and y di roof function chesthundi


donno why x is the same 3.6

nuvvemina catch chesthava leda ani ala x value thappu pettina
sSc_hidingsofa sSc_hidingsofa

u rock reeeeeeeeeee
[/quote]
@3$% emo ardham kaaledu..rendu same functions kadaa..aina y this result diff sCo_^Y

Link to comment
Share on other sites

[quote name='deals2buy' timestamp='1353335797' post='1302822500']
declare @x float, @y float

set @x = 3.65
set @y = 3.75

--What values are returned by the following statements?
select 'x = ' + str(@x,10,1)
select 'y = ' + str(@y,10,1)


nee yavva okkadu kuda follow avvatam leda? answers cheppandi vayya deeniki with reason
[/quote]
[quote name='gundugadu' timestamp='1353338316' post='1302822644']
STR function returns char data from numeric data.

the ansers are x=3.7
y=3.8
[/quote]
[quote name='deals2buy' timestamp='1353338829' post='1302822680']
thankyou for the reply

kaani naaku x=3.6, y=3.8 vastunnay mama

anduke doubt vachindi
[/quote]
[quote name='gundugadu' timestamp='1353338968' post='1302822689']
ravadam ledu baaaa
x ki 3.6 ye vasthundi
and y di roof function chesthundi


donno why x is the same 3.6

nuvvemina catch chesthava leda ani ala x value thappu pettina
sSc_hidingsofa sSc_hidingsofa

u rock reeeeeeeeeee
[/quote]

good good good

Link to comment
Share on other sites

[quote name='Desamudhuru' timestamp='1353339453' post='1302822742']
good good good
[/quote]
inthaki nee issue resolve ainda ?

Link to comment
Share on other sites

[quote name='deals2buy' timestamp='1353339510' post='1302822752']
inthaki nee issue resolve ainda ?
[/quote]
Ledu mama Evala 10(CST) ki meeting vundi manager tho chudali em ithado

Link to comment
Share on other sites

[quote name='Desamudhuru' timestamp='1353339586' post='1302822762']
Ledu mama Evala 10(CST) ki meeting vundi manager tho chudali em ithado
[/quote]


jagratha vayya..nuvvu modhati job lo ne motham manager meedaki vadilesthe ela?

inthaki manager telloda desi na?

Link to comment
Share on other sites

[quote name='Desamudhuru' timestamp='1353339586' post='1302822762']
Ledu mama Evala 10(CST) ki meeting vundi manager tho chudali em ithado
[/quote]
neee issue yendi baaaa
appudu view nundi flat file loki data pampali annav adenaaaaaaaaaaa

enka solve kakapothe cheppu

nenu code rasi pamputha BCP program
lo

Link to comment
Share on other sites

×
×
  • Create New...