|
|
I mean the proces will happen every night for the data that changed during day time.
CodeManiac
xxxxxxxxxx
xxxxxxxxxx
|
|
|
|
|
Shouldn't be a problem then.
I always try to have the database engine do most of the work.
|
|
|
|
|
select FirstTable.*,SecondTable.*<br />
from FirstTable,SecondTable<br />
where SecondTable.FirstTableColumn in (FirstTable.FirstColumn)
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
Hello,
I had posted the question before .Sorry to post it again since I thought my question went to the 2nd page.
I want to write a pivot table query and transfer the results in a table
The following query works but the result doesn't get transferred in a table
Select Cap orderby JobWorker pivot TimePeriod into CrossTabCap
Regards
Pritha
|
|
|
|
|
Well that is no reason to post again. In the first place, you double posted. Then you didn't include any code, so what do you expect?
I have just done what you could have done, Goggled for SQL Server 2005 Pivot and got loads of results with example code.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Thank you for all your replies.
|
|
|
|
|
Hello,
Before posing question even I have googled on pivot query,pivot sql query but none of the sites explained the synttax abut making a new table from a pivot query .And that's the reason I asked the question .I know the pivot query but how make a table of the results from the query.
Using INTO for the pivot query didn't work.
The following query works but I want to make a table
TRANSFORM sum(cCapacity) AS SumOfCapacity
SELECT jobworker, sum(cCapacity) AS Total
FROM cCapacity
GROUP BY JObWorker
PIVOT contract into y;
Thanks and sorry.
Pritha
|
|
|
|
|
Have you tried sub-querying the pivot?
Select *
Into Table
From
(
TRANSFORM sum(cCapacity) AS SumOfCapacity
SELECT jobworker, sum(cCapacity) AS Total
FROM cCapacity
GROUP BY JObWorker
PIVOT contract into y
) t
|
|
|
|
|
hello,
thanks for your reply.Itried your sub-query but I get the following error
Cannot use the cross-tab of a non-fixed column as a sub-query
Pritha
|
|
|
|
|
Hi,
I am working on application,which requires fetching data from an Excel sheet,for a particular row.
Please suggest me hw I can do it.
Thanks in advance
G Singh
|
|
|
|
|
|
Hi all
I am using SQL 2000 ver.
How can i store large text data in my table field .
What are the field propertys i have to use
Thank you
Kirthi
modified on Thursday, July 31, 2008 2:04 AM
|
|
|
|
|
e.g
Use
Mystring VarChar(200)
You can add as much string as you can and can increase a dimension.
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hi thank you for reply
but i want to put the table field length greater that 10,000
because my data is more to store
thank you
Kirthi
|
|
|
|
|
hi
SQL Fields are not like Storing data in a text file. So if you probably tried to add a dimension of 20000 and get an error like this
The size (20000) given to the column 'name' exceeds the maximum allowed for any data type (8000).
You should know that the Limit is "8000", and i dont understand why would you store such a large string in a Database.
So its not Possible with SQL
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
hi
ya i know the error but
just i am conforming is there any other way is there to store
like acces (memo field)
thank you
Kirthi
|
|
|
|
|
There is. Try the ntext data type.
ntext
Variable-length Unicode data with a maximum length of 2^30 - 1 (1,073,741,823) characters. Storage size, in bytes, is two times the number of characters entered. The SQL-2003 synonym for ntext is national text.
BUT
Important:
ntext, text, and image data types will be removed in a future version of Microsoft SQL Server. Avoid using these data types in new development work, and plan to modify applications that currently use them. Use nvarchar(max), varchar(max), and varbinary(max) instead. For more information, see Using Large-Value Data Types.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
hi Ashfield
Wow is it Possible?
can i see an example code, because ntext even if you try 10000,it will not work, mybe am not doing it right see
create table #test
(
P_ID int null,
Pname ntext(10000) null
)
Msg 131, Level 15, State 2, Line 5<br />
The size (10000) given to the column 'Pname' exceeds the maximum allowed for any data type (8000).
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
If you read up, your syntax is wrong
create table #b(a ntext)
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi Bob,
Do you have more information on the future non-use of those fields you described? Thanks.
Ryan
|
|
|
|
|
Check out BOL
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I need to create an application: upon user login, check the user type and decide the database that application will use for that user. Here is what I have:
1: Master database: stores user information and application configuration data, such as which db to use and connection string
2: Database I on server 1: contains all the application data for user group I.
3: Database II on server 2: contains all the application data for user group II.
4: Database I backup on server 2: as backup for user group 1 in case server 1 fails.
5: Database II backup on server 1: as backup for user group 2 in case server 2 fails.
6: Through log shipping between server 1 and server 2 to keep DB I and I and their backup up-to-date.
7: The web site is running on web farm. The session state management is using SQL server session state management, which is on the same server as Master DB.
My questions are:
1: How do I determine if server 1 or server 2 is down and it's time for application switching to use the DB backup on the other server.
2: What to do if the master DB server is down?
3: Is there a better approach than the above design to achieve the same goals: using different DB for different users, and achieving fast recovery by using the backup server?
I would really appreciate any suggestion and help!
Thanks in advance!
|
|
|
|
|
i need to write some lines to a txt when running loops in a stored procedure, is there any syntax facilitating this kind of function? or I have to use some other ways? if you have done that before, please help me, thanks..........
|
|
|
|
|
Look in BOL for xp_cmdshell.
Someone's gotta be the last to know, but why is it always me?
|
|
|
|