After customizing the role settings (changed the 'public' role, just tick everything to Deny, then I set it back), all of my users cannot login, except to give them the sysadmin permission. So, I want to reset the role settings, is there any way to do that?
...
I have the following tables:
Section and Content
And I want to relate them.
My current approach is the following table:
In which I would store
Section to Section
Section to Content
Content to Section
Content to Content
Now, while I clearly can do that by adding a pair of fields that indicate whether the source is a section or...
Hello everyone,
I am using VSTS 2008 + C# + .Net 3.5 + ADO.Net + SQL Server 2008. I have some C# string type variables, and I want to insert them into database as type DateTime, any code samples?
My problem is how to do the conversion from string to database DateTime type.
thanks in advance,
George
...
I have a float column with numbers of different length and I'm trying to convert them to varchar.
Some values exceed bigint max size, so I can't do something like this
cast(cast(float_field as bigint) as varchar(100))
I've tried using decimal, but numbers aren't of the same size, so this doesn't help too
CONVERT(varchar(100), Cast(f...
I have a table containing a large number of rows. Each row has 2 columns which I need to use - the first is some HTML formatting and the second is the text. I need to concatenate all these rows into a single string value so that I can e-mail this massive string. Due to the large number of rows I can't use a VARCHAR variable - I have t...
hi
i have 2 tables
table1: num,X,Y
table2: num,X,Y
i need to update X and Y in table1 where table1.num = table2.num
how to do it ?
i need it in Oracle query (i think that in sql server it will work too)
thank's in advance
...
i am using oledb driver for db2 NT 7.2 to create linked server the connection is fine but whenver i select on some tables i got this error The OLE DB provider "DB2OLEDB" for linked server "xxxxxx" supplied inconsistent metadata for a column. even if i did not include the column in the select.
SSIS same it not to have this problem becau...
Hi, I got a problem transforming a table that looks like this
PropertyName | PropertyValue
---------------------------------
color red
color blue
size big
size small
into this:
Color | Size
---------------------------------
red big
red small
blue big
blue small
How can I achieve this? Thanks in advance for any ...
As the question title, is there a way to do this?
eg:
DrivingLicence
---------------
CanDriveCar (bool)
CanDriveMotorbike (bool)
CanDriveBus (bool)
You can't drive a bus without a car licence, so I want the DB to throw an exception if anyone tries to give someone a bus licence when they haven't a car licence.
...
Hi,
I'm not sure of the soundness of the following architecture, but right now, the following information is for a prototype at this time.
I have a stored procedure that currently lets me:
Pass an owner memberID and say an ID for a new event record
In the member table, I have an XML field say called events, and the new event ID gets a...
I have a console app that needs to connect to a remote sql server 2008 instance....
this particular line throws an error even though i have access to that database...
connection.open() is the line that is throwing the error...
...
Good Day Sir/Madame! ^_^
I'm quite a novice when it comes to sql, so please forgive my ignorance.
I have quite a large nvarchar which I wish to pass to the HashBytes function.
I get the error:
"String or binary would be truncated.
Cannot insert the value NULL into
column 'colname', tbale 'table';
column does not allow nulls. ...
I'm trying to connect to my local Sql Server Express 2008 R2 instance (v 10.50.1600) to generate classes via sqlmetal.exe (1.00.30729) and I get the following error:
Error : Failed to generate a user instance of SQL Server. Only an integrated connection can generate a user instance. The connection will be closed.
I can connect via S...
Hey all,
I have a database server that currently has two databases, call them [A] and [B].
[A] is the standard database used for my application
[B] is used by another application (that puts considerable load on the server), however, we use a few tables sparingly (that are shared between my application and the primary application that ...
Hi All,
I am contemplating using some user defined function calls within some of my queries instead of using a bunch of inline case statements. The inline statements will probably perform better, but the functions make it so much easier to view and possibly maintain.
I just wanted to get an idea of what the typical best practice is fo...
In SQL Server 2008 I had remade the database structure similar to Access. I need to import a couple of related tables but I am worried that the foreign keys won't match with the autonumber fields from the related tables.
...
I have data
Table1
ID Name
-----------
1 n1
2 n2
3 n4
Table2
FID YearS Val
----------------------
1 2008 Up
1 2009 Down
1 2010 Up
2 2000 Up
2 2001 Down
2 2002 Up
2 2003 Up
3 2009 Down
3 2010 Up
I want to return data in following format:...
I have to get the month from a column which stores string in format -
Column
----------
`Feb2007'
'Sep2008'
So if the value was 'Feb2007' then I need to get back 2 or else if the value was 'Sep2009' then I should get back 9.
Is there inbuilt function in SQL Server 2008 to achieve something like this?
...
I have the following table called [Store_Sales] -
Store Date Sales
1 23/04 10000
2 23/04 11000
1 22/04 10000
2 22/04 10500
1 21/04 10000
2 21/04 10550
I want a SQL that will return a "run" of similar values in the Sales column for a particular store. For exampl...
I am using the SQL Server 2008 R2 "Query Designer" to design my SQL statements.
np at all.
But can this also made backwards?
Means how to get a "picture" like the Designer does from a SQL statement?
...