I have a table with two fields of interest for this particular exercise: a CHAR(3) ID and a DATETIME. The ID identifies the submitter of the data - several thousand rows. The DATETIME is not necessarily unique, either. (The primary keys are other fields of the table.)
Data for this table is submitted every six months. In December, w...
What are the key differences between MS SQL Server 2005 and 2008?
Are there any compelling reasons for upgrading (any edition, as I have a customer with multiple editions)? Or can you point to a website with either a chart or bullet point comparison of the two servers?
Also, is there anything noteworthy in the Express editions of ei...
I need to pivot one column (Numbers column).
example need this data:
a 1
a 2
b 3
b 4
c 5
d 6
d 7
d 8
d 9
e 10
e 11
e 12
e 13
e 14
Look like this
a 1 2
b 3 4
c 5
d 6 7 8 9
e 10 11 12 13 14
any help would be greatly appreciated...
...
This is the constraint I have on the Customers table.
ALTER TABLE Customers
ADD CONSTRAINT CN_CustomerPhone
CHECK (Phone LIKE '([0-9][0-9][0-9]) [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]')
Why does this fail?
INSERT INTO Customers
(CustomerName, Address, City, State, Zip, Phone)
VALUES
('Some Name','An Address', 'City goes here', ...
I have a Stored procedure which schedules a job. This Job takes a lot of time to get completed (approx 30 to 40 min). I need to get to know the status of this Job.
Below details would help me
1) How to see the list of all jobs that have got scheduled for a future time and are yet to start
2) How to see the the list of jobs running and ...
Our Test DB is suddenly missing rows. We want them back.
Is there a way to sift through everything that has happened to the database today? Each SQL statement? I presume this kind of stuff is in the transaction log, but am not sure how to view it.
Is there a way to undo delete operations?
BTW: Yes, we do have a backup, but would prefe...
I have an SQL Server DB with a table with these fields:
A bit with the default value 1, NOT NULL.
A smalldatetime with the default value gettime(), NOT NULL.
An int with no default value, IDENTITY, NOT NULL.
When I generate Linq to SQL for this table, the following happens:
The bit is given no special treatment.
The smalldatetime i...
I have been looking at the new database server we are setting up for a client and note the database files are set to grow by 1 meg everytime the file is full and the initial size is 100 MB.
I have been considering this breifly and it doesn't sound right. I've checked a few sites on DB considerations and they didn't properly explain the...
I have a format file where I want one of the columns to be "group". I'm auto-generating the format file and a client wants to upload a file with "group" as one of the columns. I could restrict it so they can't use SQL keywords, but then I need a function to determine if a column name is a SQL keyword, so I'd like to support the user be...
I have some hierarchical data - each entry has an id and a (nullable) parent entry id.
I want to retrieve all entries in the tree under a given entry. This is in a SQL Server 2005 database. I am querying it with LINQ to SQL in C# 3.5.
LINQ to SQL does not support Common Table Expressions directly. My choices are to assemble the data in ...
I've ran some "ALTER" scripts on the database [SQL Server Server 2005], and overwrote some sprocs. Is there any way to undo changes and get my old sprocs back?
Is there a way to get the scripts that were executed out of the .LDf file? That way i can re-run my initial "create" script for my sprocs.
I don't have a backup file with old sp...
What is the equivalent of the extended procedure 'xp_dirscan' in SQL Server 2005?
...
What is the best datatype to use for storing moderate amounts of text in SQL Server (2005)?
For example, imagine a table, storing information on downloads available on a website.
I want a title for the download which is brief, say varchar(20). A path, say varchar(255) then I want to store some user friendly text about the download - a d...
Is it possible to restore a backup of a SQL Server 2005 database onto an instance of SQL Server 2008?
I need to rebuild a server as it's getting rather crufty, so I plan to take this opportunity to upgrade to SQL 2008 and wondered if I'll be able to restore my backups OK.
...
This is probably a simple answer but I can't find it. I have a table with a column of integers and I want to ensure that when a row is inserted that the value in this column is greater than zero. I could do this on the code side but thought it would be best to enforce it on the table.
Thanks!
I was in error with my last comment all i...
I am dynamically adding steps to a Sql Server Agent Job, but I need to get the last step id to determine the next id in the sequence. I cannot seem to find any built in sps that can give me this information.
...
Is there a way to connect to a db with Integrated Security from multiple domains?
...
I have a full text catalog with two tables in it.
tableA has 4 columns (a1, a2, a3, a4) of wich 3 are indexed in the catalog, a2,a3,a4.
a1 is the primary key.
tableB has 3 columns (b1, b2, b3, b4), two of which are indexed in the catalog, b3 and b4. b1 is the PK of this table, b2 is the FK to tableA.
I want to do something like
SELE...
We are moving our database server to a bigger box. I have several databases with full text indexes. What is the best way to move the full text indexes?
...
i want to call a series of .sql scripts to create the initial database structure
script1.sql
script2.sql
etc.
is there any way of doing this without sqlcmd or stored procedures or any other kind of code that is not sql ?
just inside a .sql file.
...