Viewing 15 posts - 5,611 through 5,625 (of 8,731 total)
You need to learn that if you want to get the count of the rows the main option is to use "SELECT COUNT(*) FROM Table". You need to learn the...
October 26, 2014 at 10:24 pm
GilaMonster (10/25/2014)
Anyone live anywhere where they can easily get a variety of different dried chillies? Stuff Costeño, New Mexico, Choricero, Arbol, Cascabel, Ancho, Mulatto, Negro, Pasilla?
I do, but I'm not...
October 25, 2014 at 3:53 pm
I have to admit that the CROSS APPLY was because I went lazy and didn't change it for an INNER JOIN. Here's an alternative with additional columns that show how...
October 23, 2014 at 9:51 pm
There's no need to loop through the table. You should post sample data in a way that we can just execute it and start working on it. I did it...
October 23, 2014 at 7:00 pm
For one moment, forget about dynamic code. Try writing a static query that will do what you need.
When you're sure that you have the correct query, you can use the...
October 23, 2014 at 6:58 pm
You don't need to create a table each time you need to query something. A SELECT will be enough.
Check the following articles:
COUNT(): http://msdn.microsoft.com/en-us/library/ms175997.aspx
QUOTENAME(): http://msdn.microsoft.com/en-us/library/ms176114.aspx
Dynamic SQL: http://www.mssqltips.com/sqlservertip/1160/execute-dynamic-sql-commands-in-sql-server/
October 23, 2014 at 5:53 pm
No, I mean building the string. Something like this:
SELECT Top 1 'The table I need is ' + name + '. Now I can create a SELECT statement with it'
FROM...
October 23, 2014 at 4:51 pm
You have posted your code 4 times. It's easy to understand even if it's showed as a quote. When posting, review that you're using the correct tags.
Follow the instructions in...
October 23, 2014 at 4:31 pm
Your variable @MyRowCount will always return 1 or 0 because you're limiting the results.
You have a query that will return the name of the table. Using that value, build a...
October 23, 2014 at 4:12 pm
dogramone (10/23/2014)
conceptually ...
select the...
October 23, 2014 at 4:03 pm
dariuslearn (10/23/2014)
so the table name resulting from the following query should become the column name.
SELECT name
FROM sys.tables
WHERE name = (select Top 1 name from sys.tables)
;
You don't need to read...
October 23, 2014 at 3:48 pm
spaghettidba (10/23/2014)
ChrisM@Work (10/23/2014)
Luis Cazares (10/22/2014)
Did you leave something out of your post? There seems to be no reason to have the 3 left joins in that query as it is.
Without...
October 23, 2014 at 10:11 am
You don't need Pearl, you could use xp_cmdshell.
For inserting data, you could use pure T-SQL with BULK INSERT.
October 22, 2014 at 5:27 pm
Below the post textbox, there's a section for Attachments. You can use that. 😉
(See the attached image)
October 22, 2014 at 4:12 pm
Using sqlfiddle, I was able to test this:
WITH wos AS(
SELECT Id,
wo,
wodate,
...
October 22, 2014 at 3:44 pm
Viewing 15 posts - 5,611 through 5,625 (of 8,731 total)