|
I just downloaded SQL Server 2005 Express for the first time last night, and created a simple mockup of another database I'm using to store reports. I need to store unsigned 4 byte and 2 byte numbers, but I can't figure out how, or if it's possible. Is there any way to store an "unsigned int" or "unsigned smallint" as 4 and 2 byte fields, or is it simply a case of moving up and using a bigint and int respectively and wasting a little space?
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
use MS SQL Server smallint , int or bigint types, to have integers on 2, 4 or 8 bytes, but it seems that there's no unsigned notion on sql server integers...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hello
I want to know your opinion about the following situation.
This is a situation in the database
-------------------------------------
Table Address
- id
- street
- number
- cityID
Table City
- id
- name
In Code
--------
Should I have an address service class that loads (using a address dal)
id, street number, cityid from the address table and calls the city service (using a city dal) to load the corresponding city. Merge the results into an object and pass that around
OR
should the address service class load (using a address dal) to get everything back in one shot?
Meaning: one stored procedure containing 'difficult' logic or two stored procedures containg very simple logic?
Thnx for any response
|
|
|
|
|
Here's my opinion...
These kind of queries are what relational databases are all about. Doing a simple join in the query, instead of two database hits is WAY better. I don't think I've ever run across a case where I'd do two queries rather than a single join to get all of the data I need at the time.
|
|
|
|
|
Go for the one-shot. It is more effective... Give up about the entity-objects... they are useful when the colexity is very high, else use the database for what the databse is effective and good about...
/Mattias
|
|
|
|
|
natural join looks betteer, but you could make a view for this...
CREATE OR REPLACE VIEW AS
SELECT your_columns_to_return
FROM Address, City
WHERE (Address.CityID = City.id);
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
why there is a syntax error on 2 ?
1 . set @sql = @sql + N' and (summary like ''%' + @keywords + '%'')'
2 . set @sql = @sql + N' and (summary like ' + '%' + @keywords + '%' + ')'
|
|
|
|
|
I don't see a syntax error, but in number 2, @keywords isn't single quoted... your query will look something like...
and (summary like '%somevalue%') and (summary like %somevalue%)
|
|
|
|
|
I would guess it is because the '' in line 1 isn't a quotation mark, but double pings ' which means escaping the second ping.
Ping normally starts a string, but if you need pings in the string, you must escape them by adding a ping infront.
Thus the string isnt' terminated proberly in line 2.
I'd think something along that line?
---------------------------
127.0.0.1 - Sweet 127.0.0.1
|
|
|
|
|
|
ahh - yeah. I've always myself used and heard ' refered to as a ping when used in code - but yes - it is an apostorphe in english
sorry - habbits die hard
---------------------------
127.0.0.1 - Sweet 127.0.0.1
|
|
|
|
|
Hi there...
this is the problem...
U have to have an apostorph after like an you dont... so change the code to:
set @sql = @sql + N' and (summary like ''' + '%' + @keywords + '%' + ''')'
/M
|
|
|
|
|
Hi
This is part of a sp to search on db.
set @sql = @sql + N' and (summary like ''%' + @keywords + '%'')'
but it doesnt find unicode cells of table.
what should i do ?
|
|
|
|
|
Dont't use concated SQL... for this.
Create a procedure and just add the value as paramter..
Also.. beaware of the collation...
/M
|
|
|
|
|
Hello friends,
I got some problem...
I have table like
CREATE TABLE publishers
(
Name char(4) NOT NULL,
ID varchar(40) NULL,
City varchar(20) NULL,
State char(2) NULL,
Comments varchar(3000) NOT NULL
)
I have some store procedure which put xml files and put that into this sql table, now problem i am facing here is that all the character from comments column i am not getting , I already increase the width of that column from varchar(1000 ) to varchar(3000)
Two days before i am getting well results i.e. all the character from this perticular field(comments) and seeing that result, character in that field was just 800 to 850 approx.But now why I am getting like that??? One thing is sure the character which is coming from XML file is not more than 850.Then is there any setting should i change or by mistake changed??
Please Help me out!
T.I.A
Shashank
|
|
|
|
|
Try nvarchar instead of varchar.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
check the prameters for the procedure.. they has to be the same as for the table...
/M
|
|
|
|
|
I have a problem to connect to a remote SQL Server in WinXp SP2.
The error is "SQL Server does not exist or access denied".
I've done almost all of the solutions that are recommended in Microsoft support service.
I added sqlservr.exe program into the exception list of firewall included with XP SP2.
I added 1433 (TCP) and 1434 (UDP) ports into that exception list as well.
Even I disable XP SP2 firewall. but I got the problem again.
Finally I installed SQL Server Service Pack 3a but unfortunately the problem is still exist.
I really don't know what should I do after doing all of the above tasks.
Is there anybody here who can solve this problem?
Thank you in advance.
|
|
|
|
|
---Check if there is a program uses the Same ports
---Check Your Domain Account when you Try to Connect to the Server
---Try to Connect by IP address not the DNS
---check the Secury Setting in the SQL server
---Check if the Server has a firewall that prevent you from Connect
---Norton Firewall ...?
agmb
|
|
|
|
|
How does the connection string looks like...? note that the SQL-server supports several instances and that that might be a peoblem if the instance nto is specified...
/M
|
|
|
|
|
Try:
select * <br />
from aaa cross join aaaa2 <br />
where aaa.q = 1<br />
and aaaa2.e = 7
Or:
select * <br />
from aaa, aaaa2 <br />
where aaa.q = 1<br />
and aaaa2.e = 7
|
|
|
|
|
its a wrongggggggggggggggg answer u have to check ur answers first, i found another soultion which is left join or full join with omition of the alter, however tanks for trying helping me........
Thanks alot
Hamody
|
|
|
|
|
Mohammad Daba`an wrote:
its a wrongggggggggggggggg answer
That was not very polite.
Mohammad Daba`an wrote:
i found another soultion which is left join or full join with omition of the alter
Huh?! Your original request was "i need to change the following code to another one which does the same function without using join, left outer joi, or any join statements"
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Hmmm... strange select.
First of an outer join without a join... hmmm..
What the result is I can not predicct... What is the result you are looking for...?
/M
|
|
|
|
|
i have the following code:
while(true)
{
Thread.Sleep(delay);
SqlConnection connection = new SqlConnection;
connection.Open();
'some code here'
connection.Close();
}
i'm wondering how many sqlconnection will be made? after a while is it possible to get an "System.NullRefferenceException: Object not set to an instance of an object"(probably because the new connections are instantiated, but never disposed)?
thanks.
MetalSandman.
|
|
|
|