Viewing 15 posts - 7,096 through 7,110 (of 8,731 total)
To display it, you need to use CONVERT with format code 120.
You should, however, store datetime values as datetype types which have no format predefined.
January 28, 2014 at 5:17 pm
Maybe this would give you a clue on how to do it while you're inserting your data into your table variable. Why are you inserting into the table variable? Are...
January 28, 2014 at 1:12 pm
I can't reproduce your error. What are you using instead of '?'?
Can you post DDL of the table?
Here's what I used to test.
WITH SomeTable([year],[month],[day]) AS(
SELECT 2001,9,14 UNION ALL SELECT 2001,9,15)
SELECT...
January 28, 2014 at 12:28 pm
The problem is that your JOINS are duplicating the rows because of the one-to-many relationship with tables C and D.
I'm leaving here 3 options that you might consider. On the...
January 28, 2014 at 11:55 am
You have a problem here. You need to do something but you don't have the permissions to do it.
I'd say that you need to talk to your manager, DBA or...
January 28, 2014 at 9:05 am
I'm glad that you got a solution. Be sure to understand it, that's why I inclued a link to an article that goes step by step on how the solution...
January 28, 2014 at 8:52 am
I had a similar option to Nevyn but using a subquery.
SELECT citation
FROM(
SELECT header,
CAST( header AS varchar(200)) AS citation,
1 AS roworder
FROM Table_1
GROUP BY header
UNION ALL
SELECT header,
citation,
2 AS...
January 28, 2014 at 8:38 am
Deries (1/27/2014)
Thank you Jeff, Could you or anyone give me a sample code to test it out.
Read what I posted 😛
January 27, 2014 at 4:09 pm
You could easily use a cross tabs approach to this problem. You can read more about this method on the following article: http://www.sqlservercentral.com/articles/T-SQL/63681/
If you have any questions after reading the...
January 27, 2014 at 3:53 pm
I would create a calendar table and include the expression in a column so you can use it in the queries.
January 27, 2014 at 1:31 pm
And there's a recently published article by Jeff on BULK INSERT that will help you as an introduction to your process.
http://www.sqlservercentral.com/articles/BCP+(Bulk+Copy+Program)/105867/
January 27, 2014 at 12:44 pm
chillw1nston (1/27/2014)
SELECT TOP 100 --*
--,
CASE WHEN ROW_NUMBER() OVER (ORDER by object_id) % 3 = 0 THEN 'FIZZ'
WHEN ROW_NUMBER() OVER (ORDER by object_id) % 5 = 0 THEN...
January 27, 2014 at 10:13 am
There are some points that confuse me.
You say you need the first 50 entries from your table. How do you define the first 50? What order do you have? Why...
January 27, 2014 at 8:43 am
Do you have a calendar table?
January 24, 2014 at 2:27 pm
Hi Andrew,
Here are two options you might consider.
WITH SampleData AS(
SELECT '005863913 00002' String)
SELECT CAST( LEFT( String, CHARINDEX( ' ', String)) AS Int) AS AsInteger,
SUBSTRING( LEFT( String, CHARINDEX( ' ', String)),...
January 24, 2014 at 12:55 pm
Viewing 15 posts - 7,096 through 7,110 (of 8,731 total)