I have a SQL Server 2022 database and Visual Studio 2022. The database has a join table connecting several other tables. There is a view that shows the join table with the joined tables values rather than the keys used in the join table (all keys are uniqueidentifiers). I am a beginner with SSIS...
I've got SQL Server 2022 and am trying to learn SSIS to go with it. However, I can't find any books for SSIS 2022 nor any YouTube videos. When I try to use an old SSIS 2005 book, tries to lead me through SQL Server Data Tools, which don't seem to exist in SQL Server 2022. Am I doing something...
I have seen an application that uses an Access database without the user's computer needing to have MS Access installed. Once someone has created the database in MS Access, how do they create this version of the database?
Someone, in their infinite wisdom has created a website that connects to a database. This website has a data entry form which has a field into which three pieces of information are to be entered separated by slashes (/). The .sql code in the database then breaks up the three pieces of...
I have a column of dropdowns. I would like to be able to set cell A1 (it can be any given cell) equal to the value selected from the dropdown. Is there any way of doing it with Excel functions rather than using macros?
A column was accidentally deleted from a table and needs to be added back in the same place that it was originally. Using Design from the Object Explorer for the table in question, I can easily add the column wherever I want in the table. However, when I go to leave, I get a message that says I...
I am a photographer and keep my photos and associated post-processing info on an external hard drive. I also have a second hard drive to act as a backup of the first hard drive. What I didn't realize was that each time there was a backup, it was added to the second hard drive. I now find that...
I need a function within a script. At any time when this script is run, the function may or may not exist. I have tried writing it in the form of
IF EXISTS
DROP FUNCTION
GO
CREATE FUNCTION
GO
This gives an error saying the function already exists (I guess because they are in separate...
I have a table in which people have more than one record (they tend to be duplicates) and need to select only one record for each person. This could be done with a cursor but I believe there is a way to phrase a SELECT statement that will give me the desired result. The fields involved are...
I have database that handles maintenance records for buildings in various office parks around the country. The country is divide up into regions and one of the the office in one of these office parks is responsible for handling the records for all the office parks in a given region. There is a...
I have a script (can't us stored procedure) that checks for duplicate records and then eliminates them. It first selects dups and then checks variable, @DeleteDups, to determine if the user wants to eliminate one dups until only one record is left. If @DeleteDups = 1, the delete portion of the...
I have a database that imports data from an Excel spreadsheet by right clicking the database in Object Explorer and selecting Task > Import Data. I've run into a problem with a particular spreadsheet in which the user has written War and Peace in one of the cells, but it seems that all of the...
I want to know if "Paris" exists in a table of cities. I've read that
IF EXISTS(SELECT * FROM tblCities WHERE fldCityName = 'Paris') PRINT 'Paris Exists'
is better than
IF(SELECT COUNT(*) FROM tblCities WHERE fldCityName = 'Paris') > 0 PRINT 'Paris Exists
because in the first case, as soon as it...
I have an Excel spreadsheet with dates formatted dd/mm/yyyy. No matter how I tell Excel to format these columns, SQL always imports them as VARCHAR(255)
When I then try to get them back into the mm/dd/yyyy format, FORMAT chokes.
This works:
DECLARE @D VARCHAR(10)
DECLARE @DDt DATE
SET @D =...
I am trying to bring in data from an Excel spreadsheet. I've been using the SQL Server Import and Export Wizard and that seems to have been working. However, while checking something else, I noticed that any long entries are truncated at 255 characters. I've tried changing the Excel column...
I have a table with an XML field in which many of the XML entries don't have the <?xml version="1.0" encoding="utf-8"?> prefix. How would I write an update statement to tack that onto the front of the XML statement? The error I get is "The data types varchar and xml are incompatible in the add...
I have set size limits on some fields using Data Validation. This works fine when a value is typed in, but if the value is pasted in this doesn't seem to work. Is there a way to make the Data Validation rules apply to pasted values as well as those typed in?
(Or is there a way to prevent values...
If someone enters .123 into a numeric column (or a General column), Excel will add a leading zero resulting in 0.123.
Is there any way, other than defining the column as Text, to prevent the leading zero from being added? This needs to be done for a particular workbook, not the Excel app in genera.
I have a worksheet with two dropdown boxes. The first one references a fixed table on a separate sheet. The second, whose choices are set by the selection made in the first dropdown box, is driven by a pivot table. The fixed table consists of the columns MainAssetType, SubAssetType and...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.