Viewing 15 posts - 4,216 through 4,230 (of 15,381 total)
Assuming your data in consistent (ROFL) you could do something like this.
declare @SomeValue varchar(20) = 'john fernandez'
select LEFT(@SomeValue, 1) + SUBSTRING(@SomeValue, charIndex(' ', @SomeValue) +1, len(@SomeValue))
This is why we store...
July 2, 2014 at 2:10 pm
I still don't understand why you need the columns to be dynamic. The number of columns doesn't change. Code it once and be done with it. The dynamic solution saves...
July 2, 2014 at 2:04 pm
Alan.B (7/2/2014)
Sean Lange (7/2/2014)
July 2, 2014 at 1:58 pm
If you use the quirky update please make sure you read the article carefully. There are a number of extremely important requirements that must be met for this to work....
July 2, 2014 at 1:07 pm
sifar786 (7/2/2014)
Right now, can you help me with the sp and dynamic generation of columns as right now i am pulling my hair and...
July 2, 2014 at 1:02 pm
vecerda (7/2/2014)
You sir! are a a lifesaver. I see how this is a much better way of doing this,thanks for pointing me in right direction,
Petr
You are quite welcome. The crosstab...
July 2, 2014 at 12:38 pm
sifar786 (7/2/2014)
i donot understand why i should be using a cross tab as i am a newbie. kindly elaborate.
Read the articles I suggested. A cross tab is much easier to...
July 2, 2014 at 12:36 pm
vecerda (7/2/2014)
July 2, 2014 at 12:33 pm
What you will need to do is create a new table with the structure you want. Then copy all the data from the current table into the new one. Drop...
July 2, 2014 at 12:30 pm
vecerda (7/2/2014)
I am having trouble figuring out why the following code throws an error:
declare
@cols nvarchar(50),
@stmt nvarchar(max)
select @cols = ('[' +...
July 2, 2014 at 12:26 pm
sifar786 (7/2/2014)
no one on this forum knows how to use dynamic sql to generate 1 to 52 numbers in pivot column?:ermm:
I wouldn't use PIVOT for this. I would use a...
July 2, 2014 at 12:14 pm
Minnu (7/2/2014)
I've a large table in my SQL database with more than 10 million records, i want to clean the table every week by
deleting the records older than...
July 2, 2014 at 11:14 am
Bill Talada (7/2/2014)
Update: We are getting away from Identity primary keys and going to guids which are easier to insert in batches.
I hope you have also made these guids a...
July 2, 2014 at 11:07 am
siri_rmsi (7/2/2014)
------------------------------
Attach database failed for Server 'xyz'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.2218.0+((SQL11_RTM_GDR).120612-1250+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Directory lookup for...
July 2, 2014 at 10:55 am
No problem. Glad that helped. 😀
July 2, 2014 at 10:49 am
Viewing 15 posts - 4,216 through 4,230 (of 15,381 total)