Viewing 15 posts - 2,416 through 2,430 (of 2,894 total)
DataDog (8/12/2010)
create some helper functions:
public static string SqlName(string name) {
return "[" + name.Replace("]", "]]") + "]";
}//method
public static string SqlString(string name) {
return "'" + name.Replace("'", "''") + "'";
}//method
if you're...
August 12, 2010 at 4:07 am
Raghavender (8/11/2010)
I am developing a report, In which I need to select creditors group either single one or all creditors gorups, can you please let me know how to...
August 12, 2010 at 3:37 am
You can do this:
declare @T table
(col1 int,
col3 char(3))
insert into @T
select 1, '<A>' union all
select 1, '<B>' union all
select 1, '<C>' union all
select 1, '<D>' union all
select 2, '<E>' union all
select...
August 11, 2010 at 8:36 am
Sorry mate, no one said that your solution need 1000+ stored procedures and 400+ views and 350+ temporary tables. Actuallty, no one here in position to advise about these numbers...
August 11, 2010 at 8:13 am
dennisv (8/11/2010)
...I don't write SQL enough to get good at it...
...
No offence, but do you seriously believe that writing "enough" in C# makes you good in it? 😉
Hornestly, before advising...
August 11, 2010 at 6:52 am
Add non-clustered index on mf_cd in mj_reg_stats table!
If you check the current query plan, I believe you will see index scan there. Adding the above index together with the index...
August 11, 2010 at 6:30 am
When last time statistic was updated on the tables?
UPDATE STATISTICS table_or_indexed_view_name
August 11, 2010 at 6:18 am
Do you have an index on mf_cd in mj..stat_type?
You can try using "OPTION (MAXDOP 1)" and see if you have any performance gain (just add it at the end...
August 11, 2010 at 6:15 am
1. Use ANSI joins: "FROM T1, T2 WHERE ..." should be changed to
"FROM T1 JOIN T2 ON ..."
2. Do insert in batches. Try 2,000,000 rows at the time. You...
August 11, 2010 at 4:59 am
What crashes with the mentioned error? Why you think that it's related to COPY?
The error clearly says that it cannot find object 'DATA$' - there is nothing bout COPY. Do...
August 11, 2010 at 4:54 am
Change to:
SET @SQL=N'INSERT INTO OPENROWSET(''Microsoft.Jet.OLEDB.4.0'',''Excel 8.0;DATABASE='+@xlFileName+''',''Select * from [DATA$]'')SELECT COMPANY,LOANREF,AGREEMENTNUMBER,SOLREF,FIRSTNAME,SURNAME,ADD1,ADD2,ADD3,POSTCODE,CAPITAL,INTEREST,FEES,BALANCE,STARTDATE,DUEDATE,LOANTYPE FROM TBL_STATEMENTS where PRACID = ' + CAST(@PRACID as varchar(11)) + ';'
As you had it before, @PRACID would be local...
August 11, 2010 at 4:25 am
Hard to say about all SQLServer versions...
In SQL2008 setting compatibility level to 80, allows to execute queries with non-ANSI joins and the result of your query is the same as...
August 11, 2010 at 4:15 am
sudhanva (8/11/2010)
GilaMonster (8/11/2010)
Post the view definition?
CREATE VIEW [View1]
AS
SELECT ROW_NUMBER() OVER (ORDER BY VERSIONID) AS ROW_NUMBER,* FROM
(SELECT Col1, Col2, Col3, Col4, Col5, Col6, Col7, Col8, [value]
from Table1
WHERE PARAMETERNAME in (SELECT...
August 11, 2010 at 3:38 am
Your sql statement is incomplete:
INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;DATABASE=D:\Eatons.XLS','Select * from [DATA$]')
Insert what? Have you looked into syntax of statement you are using?
Google usually helps...
It should look something like:
insert into...
August 11, 2010 at 3:16 am
You can upload XML files and analyse them using T-SQL
August 11, 2010 at 2:44 am
Viewing 15 posts - 2,416 through 2,430 (of 2,894 total)