I have the following tables:
1-Categories:
-CategoryID
-CategoryName
-ParentID
2-Items:
-ItemId
-ItemName
-CategoryID
categories can be in a hierarchically view, with many children categories inside each other.
And any the last child category can have items, so just the last category child will show items under it.
The view will be lik...
I am working on a consumer facing web application built on .Net/C# MSSQL as the databse
We have been following general good coding practices to prevent bugs and SQL/JS query injections but non of us are experts on security.
What would be a good checklist to find out how really secure is the application we are building.
...
For the sake of argument, let's just say I have to create a local variable containing a SQL query that has an INSERT:
DECLARE @insert NVARCHAR(MAX)
SELECT @insert = 'INSERT INTO [dbo].[' + @table + '] VALUES...
EXEC (@insert)
This INSERT is also going to contain a column value:
DECLARE @insert NVARCHAR(MAX)
SELECT @insert =
'I...
I'm working on an SSIS package where I'm importing data from a CSV file into a SQL table.
The only field that I'm concern with is the Username. This Username must be unique. I don't care whether first name or last name are the same or not.
In the package, I imported the data from file into a temp SQL table. And then I used SELECT DISTI...
Hi
I'am looking for good tool that can convert from Oracle to sql server and from sql server to oracle.
I found some, but there was many errors during the conversion
thank's in advance
...
Is there a direct route that is pretty straight forward? (i.e. can SQL Server read XML)
Or, is it best to parse the XML and just transfer it in the usual way via ADO.Net either as individual rows or perhaps a batch update?
I realize there may be solutions that involve large complex stored procs--while I'm not entirely opposed to this,...
I've connected to a few databases once and only once and will never need to again, however they clutter up the dropdown of logins available to select.
How can I reset the lists of servers and logins from the connection prompt in SQL Server Management Studio Express 2008?
...
I found out about the freeTDS which can be used here, but there are doubts about its stability in the production environment. Is there any other way to interactive with MSSQL Server from Solaris besides using ODBC driver?
...
When I connect to the SQL Server 2008 remotely it only works once, after that the server hangs. The service cannot be stopped or restarted and when trying to connect again it gives a 'Timeout' error.
The server has TCP/IP connections enabled. The default port is set to 1433 and I cleared the 0 from the dynamic ports. I enabled the 127.0...
Hi, I have a fact table that holds all date & time attributes as keys which links to actual DATE & TIME dimension.
When I create a cube on top of it using SSAS 2005, these datetime attributes are split into individual dimensions for the CUBE, which is OK.
Problem is when I add a new datetime attribute to the fact table, my cube doesn't ...
I have a datetime column in a table called 'createdDate' were the default value is set to getutcdate(). However when a row is added to the table the createdDate's time value is 1 hour behind the system time. So my question is how do I increase the current database system timestamp by 1 hour?
Thanks in advance.
...
Hi
Can any one explain whyand where to use operators and alerts in sqlserver nmanagement studio
...
It was reveled today that the new standard of SQL will include specification of some new database operations that will allow using databases for Fuzzy Logic operations.
This new functionality is said to be implemented in SQL Server 2009 AF Edition and mySQL9.1.4
There were 2 new keywords introduced
The new keyword is called JOINT which...
I am currently trying out visual studio to access sql server databases instead of using SQL Server Management Studio.
It was a good surprise how easy it is to setup and use a connection do a database and for the moment it has a positive impact on my productivity.
My question is: Is there an addon (or something i can do) to enable intel...
I've a PK constraint - a clustered index on two columns - which I am in the process of dropping. The command is still running after an hour. I would have thought that as I am just removing a constraint the operation would be nearly instantaneous.
Can someone explain to me what is actually happening under the hood when I drop the PK?
...
I have a table with a nvarchar column. This column has values for example:
983
294
a343
a3546f
and so on.
I would like to take MAX of this values, but not as text but like from numerics. So in this example numerics are:
983
294
343
3546
And the MAX value is the last one - 3546. How to do this in TSQL on Microsoft SQL?
...
table1 has 3 columns:
Id UserName SubmittedDate
1 Joe 1/1/2006
2 Joe 1/1/2007
3 Nat 1/1/2008
4 Pat 1/1/2009
I want to return this:
Id UserName
2 Joe
3 Nat
4 Pat
I just want just one record for Joe, the most recent one.
How do I write this query? Thanks
...
I have a database which tries to acheive point-in-time information by having a master table and a history table which records when fields in the other table will/did change. e.g.
Table: Employee
Id | Name | Department
-----------------------------
0 | Alice | 1
1 | Bob | 1
Table: History
ChangeDate | Field ...
I have the following query:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[Validate]
@a varchar(50),
@b varchar(50) output
AS
SET @Password =
(SELECT Password
FROM dbo.tblUser
WHERE Login = @a)
RETURN @b
GO
This compiles perfectly fine.
In C#, I want to execute this query and get the return value.
My code ...
I'd like to put the results of a stored proc into a temp table. It seems that the temp table must be defined beforehand and an INSERT INTO will not work.
Anyone know how to get the schema of the recordset being returned from a select statement?
sp_help only gets info on parameters.
...